471 }
472 void set_change_young_gen_for_min_pauses(int v) {
473 _change_young_gen_for_min_pauses = v;
474 }
475 void set_decrease_for_footprint(int v) { _decrease_for_footprint = v; }
476 int decrease_for_footprint() const { return _decrease_for_footprint; }
477 int decide_at_full_gc() { return _decide_at_full_gc; }
478 void set_decide_at_full_gc(int v) { _decide_at_full_gc = v; }
479
480 // Check the conditions for an out-of-memory due to excessive GC time.
481 // Set _gc_overhead_limit_exceeded if all the conditions have been met.
482 void check_gc_overhead_limit(size_t young_live,
483 size_t eden_live,
484 size_t max_old_gen_size,
485 size_t max_eden_size,
486 bool is_full_gc,
487 GCCause::Cause gc_cause,
488 CollectorPolicy* collector_policy);
489
490 static bool should_update_promo_stats(GCCause::Cause cause) {
491 return ((cause == GCCause::_java_lang_system_gc &&
492 UseAdaptiveSizePolicyWithSystemGC) ||
493 GCCause::is_tenured_allocation_failure_gc(cause));
494 }
495
496 // Printing support
497 virtual bool print_adaptive_size_policy_on(outputStream* st) const;
498 bool print_adaptive_size_policy_on(outputStream* st,
499 uint tenuring_threshold) const;
500 };
501
502 // Class that can be used to print information about the
503 // adaptive size policy at intervals specified by
504 // AdaptiveSizePolicyOutputInterval. Only print information
505 // if an adaptive size policy is in use.
506 class AdaptiveSizePolicyOutput : StackObj {
507 AdaptiveSizePolicy* _size_policy;
508 bool _do_print;
509 bool print_test(uint count) {
510 // A count of zero is a special value that indicates that the
511 // interval test should be ignored. An interval is of zero is
|
471 }
472 void set_change_young_gen_for_min_pauses(int v) {
473 _change_young_gen_for_min_pauses = v;
474 }
475 void set_decrease_for_footprint(int v) { _decrease_for_footprint = v; }
476 int decrease_for_footprint() const { return _decrease_for_footprint; }
477 int decide_at_full_gc() { return _decide_at_full_gc; }
478 void set_decide_at_full_gc(int v) { _decide_at_full_gc = v; }
479
480 // Check the conditions for an out-of-memory due to excessive GC time.
481 // Set _gc_overhead_limit_exceeded if all the conditions have been met.
482 void check_gc_overhead_limit(size_t young_live,
483 size_t eden_live,
484 size_t max_old_gen_size,
485 size_t max_eden_size,
486 bool is_full_gc,
487 GCCause::Cause gc_cause,
488 CollectorPolicy* collector_policy);
489
490 static bool should_update_promo_stats(GCCause::Cause cause) {
491 return ((GCCause::is_system_gc(cause) &&
492 UseAdaptiveSizePolicyWithSystemGC) ||
493 GCCause::is_tenured_allocation_failure_gc(cause));
494 }
495
496 // Printing support
497 virtual bool print_adaptive_size_policy_on(outputStream* st) const;
498 bool print_adaptive_size_policy_on(outputStream* st,
499 uint tenuring_threshold) const;
500 };
501
502 // Class that can be used to print information about the
503 // adaptive size policy at intervals specified by
504 // AdaptiveSizePolicyOutputInterval. Only print information
505 // if an adaptive size policy is in use.
506 class AdaptiveSizePolicyOutput : StackObj {
507 AdaptiveSizePolicy* _size_policy;
508 bool _do_print;
509 bool print_test(uint count) {
510 // A count of zero is a special value that indicates that the
511 // interval test should be ignored. An interval is of zero is
|