391 }
392
393
394 void AdaptiveSizePolicy::clear_generation_free_space_flags() {
395 set_change_young_gen_for_min_pauses(0);
396 set_change_old_gen_for_maj_pauses(0);
397
398 set_change_old_gen_for_throughput(0);
399 set_change_young_gen_for_throughput(0);
400 set_decrease_for_footprint(0);
401 set_decide_at_full_gc(0);
402 }
403
404 void AdaptiveSizePolicy::check_gc_overhead_limit(
405 size_t young_live,
406 size_t eden_live,
407 size_t max_old_gen_size,
408 size_t max_eden_size,
409 bool is_full_gc,
410 GCCause::Cause gc_cause,
411 CollectorPolicy* collector_policy) {
412
413 // Ignore explicit GC's. Exiting here does not set the flag and
414 // does not reset the count. Updating of the averages for system
415 // GC's is still controlled by UseAdaptiveSizePolicyWithSystemGC.
416 if (GCCause::is_user_requested_gc(gc_cause) ||
417 GCCause::is_serviceability_requested_gc(gc_cause)) {
418 return;
419 }
420 // eden_limit is the upper limit on the size of eden based on
421 // the maximum size of the young generation and the sizes
422 // of the survivor space.
423 // The question being asked is whether the gc costs are high
424 // and the space being recovered by a collection is low.
425 // free_in_young_gen is the free space in the young generation
426 // after a collection and promo_live is the free space in the old
427 // generation after a collection.
428 //
429 // Use the minimum of the current value of the live in the
430 // young gen or the average of the live in the young gen.
431 // If the current value drops quickly, that should be taken
|
391 }
392
393
394 void AdaptiveSizePolicy::clear_generation_free_space_flags() {
395 set_change_young_gen_for_min_pauses(0);
396 set_change_old_gen_for_maj_pauses(0);
397
398 set_change_old_gen_for_throughput(0);
399 set_change_young_gen_for_throughput(0);
400 set_decrease_for_footprint(0);
401 set_decide_at_full_gc(0);
402 }
403
404 void AdaptiveSizePolicy::check_gc_overhead_limit(
405 size_t young_live,
406 size_t eden_live,
407 size_t max_old_gen_size,
408 size_t max_eden_size,
409 bool is_full_gc,
410 GCCause::Cause gc_cause,
411 GenCollectorPolicy* collector_policy) {
412
413 // Ignore explicit GC's. Exiting here does not set the flag and
414 // does not reset the count. Updating of the averages for system
415 // GC's is still controlled by UseAdaptiveSizePolicyWithSystemGC.
416 if (GCCause::is_user_requested_gc(gc_cause) ||
417 GCCause::is_serviceability_requested_gc(gc_cause)) {
418 return;
419 }
420 // eden_limit is the upper limit on the size of eden based on
421 // the maximum size of the young generation and the sizes
422 // of the survivor space.
423 // The question being asked is whether the gc costs are high
424 // and the space being recovered by a collection is low.
425 // free_in_young_gen is the free space in the young generation
426 // after a collection and promo_live is the free space in the old
427 // generation after a collection.
428 //
429 // Use the minimum of the current value of the live in the
430 // young gen or the average of the live in the young gen.
431 // If the current value drops quickly, that should be taken
|