提交 7ac26a8c 编写于 作者: B brutisso

8005972: ParNew should not update the tenuring threshold when promotion failed has occurred

Reviewed-by: ysr, johnc, jwilhelm
上级 f4d5e178
...@@ -878,12 +878,6 @@ void EvacuateFollowersClosureGeneral::do_void() { ...@@ -878,12 +878,6 @@ void EvacuateFollowersClosureGeneral::do_void() {
bool ParNewGeneration::_avoid_promotion_undo = false; 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. // A Generation that does parallel young-gen collection.
void ParNewGeneration::collect(bool full, void ParNewGeneration::collect(bool full,
...@@ -1013,6 +1007,8 @@ void ParNewGeneration::collect(bool full, ...@@ -1013,6 +1007,8 @@ void ParNewGeneration::collect(bool full,
size_policy->reset_gc_overhead_limit_count(); size_policy->reset_gc_overhead_limit_count();
assert(to()->is_empty(), "to space should be empty now"); assert(to()->is_empty(), "to space should be empty now");
adjust_desired_tenuring_threshold();
} else { } else {
assert(_promo_failure_scan_stack.is_empty(), "post condition"); assert(_promo_failure_scan_stack.is_empty(), "post condition");
_promo_failure_scan_stack.clear(true); // Clear cached segments. _promo_failure_scan_stack.clear(true); // Clear cached segments.
...@@ -1035,7 +1031,6 @@ void ParNewGeneration::collect(bool full, ...@@ -1035,7 +1031,6 @@ void ParNewGeneration::collect(bool full,
from()->set_concurrent_iteration_safe_limit(from()->top()); from()->set_concurrent_iteration_safe_limit(from()->top());
to()->set_concurrent_iteration_safe_limit(to()->top()); to()->set_concurrent_iteration_safe_limit(to()->top());
adjust_desired_tenuring_threshold();
if (ResizePLAB) { if (ResizePLAB) {
plab_stats()->adjust_desired_plab_sz(n_workers); plab_stats()->adjust_desired_plab_sz(n_workers);
} }
......
...@@ -347,10 +347,6 @@ class ParNewGeneration: public DefNewGeneration { ...@@ -347,10 +347,6 @@ class ParNewGeneration: public DefNewGeneration {
bool survivor_overflow() { return _survivor_overflow; } bool survivor_overflow() { return _survivor_overflow; }
void set_survivor_overflow(bool v) { _survivor_overflow = v; } 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: public:
ParNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level); ParNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level);
......
...@@ -550,6 +550,11 @@ HeapWord* DefNewGeneration::expand_and_allocate(size_t size, ...@@ -550,6 +550,11 @@ HeapWord* DefNewGeneration::expand_and_allocate(size_t size,
return allocate(size, is_tlab); 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, void DefNewGeneration::collect(bool full,
bool clear_all_soft_refs, bool clear_all_soft_refs,
...@@ -649,9 +654,7 @@ void DefNewGeneration::collect(bool full, ...@@ -649,9 +654,7 @@ void DefNewGeneration::collect(bool full,
assert(to()->is_empty(), "to space should be empty now"); assert(to()->is_empty(), "to space should be empty now");
// Set the desired survivor size to half the real survivor space adjust_desired_tenuring_threshold();
_tenuring_threshold =
age_table()->compute_tenuring_threshold(to()->capacity()/HeapWordSize);
// A successful scavenge should restart the GC time limit count which is // A successful scavenge should restart the GC time limit count which is
// for full GC's. // for full GC's.
......
...@@ -124,7 +124,9 @@ protected: ...@@ -124,7 +124,9 @@ protected:
_should_allocate_from_space = true; _should_allocate_from_space = true;
} }
protected: // Tenuring
void adjust_desired_tenuring_threshold();
// Spaces // Spaces
EdenSpace* _eden_space; EdenSpace* _eden_space;
ContiguousSpace* _from_space; ContiguousSpace* _from_space;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册