5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 // This class keeps statistical information and computes the 26 // optimal free space for both the young and old generation 27 // based on current application characteristics (based on gc cost 28 // and application footprint). 29 // 30 // It also computes an optimal tenuring threshold between the young 31 // and old generations, so as to equalize the cost of collections 32 // of those generations, as well as optimial survivor space sizes 33 // for the young generation. 34 // 35 // While this class is specifically intended for a generational system 36 // consisting of a young gen (containing an Eden and two semi-spaces) 37 // and a tenured gen, as well as a perm gen for reflective data, it 38 // makes NO references to specific generations. 39 // 40 // 05/02/2003 Update 41 // The 1.5 policy makes use of data gathered for the costs of GC on 42 // specific generations. That data does reference specific 43 // generation. Also diagnostics specific to generations have 44 // been added. 367 size_t live_at_last_full_gc() { 368 return _live_at_last_full_gc; 369 } 370 371 size_t bytes_absorbed_from_eden() const { return _bytes_absorbed_from_eden; } 372 void reset_bytes_absorbed_from_eden() { _bytes_absorbed_from_eden = 0; } 373 374 void set_bytes_absorbed_from_eden(size_t val) { 375 _bytes_absorbed_from_eden = val; 376 } 377 378 // Update averages that are always used (even 379 // if adaptive sizing is turned off). 380 void update_averages(bool is_survivor_overflow, 381 size_t survived, 382 size_t promoted); 383 384 // Printing support 385 virtual bool print_adaptive_size_policy_on(outputStream* st) const; 386 }; | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP 27 28 #include "gc_implementation/shared/adaptiveSizePolicy.hpp" 29 #include "gc_implementation/shared/gcStats.hpp" 30 #include "gc_implementation/shared/gcUtil.hpp" 31 #include "gc_interface/gcCause.hpp" 32 33 // This class keeps statistical information and computes the 34 // optimal free space for both the young and old generation 35 // based on current application characteristics (based on gc cost 36 // and application footprint). 37 // 38 // It also computes an optimal tenuring threshold between the young 39 // and old generations, so as to equalize the cost of collections 40 // of those generations, as well as optimial survivor space sizes 41 // for the young generation. 42 // 43 // While this class is specifically intended for a generational system 44 // consisting of a young gen (containing an Eden and two semi-spaces) 45 // and a tenured gen, as well as a perm gen for reflective data, it 46 // makes NO references to specific generations. 47 // 48 // 05/02/2003 Update 49 // The 1.5 policy makes use of data gathered for the costs of GC on 50 // specific generations. That data does reference specific 51 // generation. Also diagnostics specific to generations have 52 // been added. 375 size_t live_at_last_full_gc() { 376 return _live_at_last_full_gc; 377 } 378 379 size_t bytes_absorbed_from_eden() const { return _bytes_absorbed_from_eden; } 380 void reset_bytes_absorbed_from_eden() { _bytes_absorbed_from_eden = 0; } 381 382 void set_bytes_absorbed_from_eden(size_t val) { 383 _bytes_absorbed_from_eden = val; 384 } 385 386 // Update averages that are always used (even 387 // if adaptive sizing is turned off). 388 void update_averages(bool is_survivor_overflow, 389 size_t survived, 390 size_t promoted); 391 392 // Printing support 393 virtual bool print_adaptive_size_policy_on(outputStream* st) const; 394 }; 395 396 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSADAPTIVESIZEPOLICY_HPP |