# HG changeset patch # User brutisso # Date 1358195445 -3600 # Node ID a30e7b564541572ec30b4d1ab31b7faffd65ece8 # Parent 689e1218d7fe740976eb4c2a60826d2bc90455cd 8005972: ParNew should not update the tenuring threshold when promotion failed has occurred Reviewed-by: ysr, johnc, jwilhelm diff -r 689e1218d7fe -r a30e7b564541 src/share/vm/gc_implementation/parNew/parNewGeneration.cpp --- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Mon Jan 14 09:58:52 2013 +0100 +++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Mon Jan 14 21:30:45 2013 +0100 @@ -878,12 +878,6 @@ bool ParNewGeneration::_avoid_promotion_undo = false; -void ParNewGeneration::adjust_desired_tenuring_threshold() { - // Set the desired survivor size to half the real survivor space - _tenuring_threshold = - age_table()->compute_tenuring_threshold(to()->capacity()/HeapWordSize); -} - // A Generation that does parallel young-gen collection. void ParNewGeneration::collect(bool full, @@ -1013,6 +1007,8 @@ size_policy->reset_gc_overhead_limit_count(); assert(to()->is_empty(), "to space should be empty now"); + + adjust_desired_tenuring_threshold(); } else { assert(_promo_failure_scan_stack.is_empty(), "post condition"); _promo_failure_scan_stack.clear(true); // Clear cached segments. @@ -1035,7 +1031,6 @@ from()->set_concurrent_iteration_safe_limit(from()->top()); to()->set_concurrent_iteration_safe_limit(to()->top()); - adjust_desired_tenuring_threshold(); if (ResizePLAB) { plab_stats()->adjust_desired_plab_sz(n_workers); } diff -r 689e1218d7fe -r a30e7b564541 src/share/vm/gc_implementation/parNew/parNewGeneration.hpp --- a/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp Mon Jan 14 09:58:52 2013 +0100 +++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp Mon Jan 14 21:30:45 2013 +0100 @@ -347,10 +347,6 @@ bool survivor_overflow() { return _survivor_overflow; } void set_survivor_overflow(bool v) { _survivor_overflow = v; } - // Adjust the tenuring threshold. See the implementation for - // the details of the policy. - virtual void adjust_desired_tenuring_threshold(); - public: ParNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level); diff -r 689e1218d7fe -r a30e7b564541 src/share/vm/memory/defNewGeneration.cpp --- a/src/share/vm/memory/defNewGeneration.cpp Mon Jan 14 09:58:52 2013 +0100 +++ b/src/share/vm/memory/defNewGeneration.cpp Mon Jan 14 21:30:45 2013 +0100 @@ -550,6 +550,11 @@ return allocate(size, is_tlab); } +void DefNewGeneration::adjust_desired_tenuring_threshold() { + // Set the desired survivor size to half the real survivor space + _tenuring_threshold = + age_table()->compute_tenuring_threshold(to()->capacity()/HeapWordSize); +} void DefNewGeneration::collect(bool full, bool clear_all_soft_refs, @@ -649,9 +654,7 @@ assert(to()->is_empty(), "to space should be empty now"); - // Set the desired survivor size to half the real survivor space - _tenuring_threshold = - age_table()->compute_tenuring_threshold(to()->capacity()/HeapWordSize); + adjust_desired_tenuring_threshold(); // A successful scavenge should restart the GC time limit count which is // for full GC's. diff -r 689e1218d7fe -r a30e7b564541 src/share/vm/memory/defNewGeneration.hpp --- a/src/share/vm/memory/defNewGeneration.hpp Mon Jan 14 09:58:52 2013 +0100 +++ b/src/share/vm/memory/defNewGeneration.hpp Mon Jan 14 21:30:45 2013 +0100 @@ -124,7 +124,9 @@ _should_allocate_from_space = true; } - protected: + // Tenuring + void adjust_desired_tenuring_threshold(); + // Spaces EdenSpace* _eden_space; ContiguousSpace* _from_space;