提交 3b7a4c32 编写于 作者: T tonyp

6904967: G1: some CollectionUsageThreshold tests fail

Summary: ensure that max and committed are non-zero (currently: at least as large as the region size).
Reviewed-by: iveresov, mchung
上级 7cf4209d
...@@ -40,7 +40,7 @@ G1MemoryPoolSuper::G1MemoryPoolSuper(G1CollectedHeap* g1h, ...@@ -40,7 +40,7 @@ G1MemoryPoolSuper::G1MemoryPoolSuper(G1CollectedHeap* g1h,
// See the comment at the top of g1MemoryPool.hpp // See the comment at the top of g1MemoryPool.hpp
size_t G1MemoryPoolSuper::eden_space_committed(G1CollectedHeap* g1h) { size_t G1MemoryPoolSuper::eden_space_committed(G1CollectedHeap* g1h) {
return eden_space_used(g1h); return MAX2(eden_space_used(g1h), (size_t) HeapRegion::GrainBytes);
} }
// See the comment at the top of g1MemoryPool.hpp // See the comment at the top of g1MemoryPool.hpp
...@@ -54,12 +54,14 @@ size_t G1MemoryPoolSuper::eden_space_used(G1CollectedHeap* g1h) { ...@@ -54,12 +54,14 @@ size_t G1MemoryPoolSuper::eden_space_used(G1CollectedHeap* g1h) {
// See the comment at the top of g1MemoryPool.hpp // See the comment at the top of g1MemoryPool.hpp
size_t G1MemoryPoolSuper::eden_space_max(G1CollectedHeap* g1h) { size_t G1MemoryPoolSuper::eden_space_max(G1CollectedHeap* g1h) {
// This should ensure that it returns a value no smaller than the
// region size. Currently, eden_space_committed() guarantees that.
return eden_space_committed(g1h); return eden_space_committed(g1h);
} }
// See the comment at the top of g1MemoryPool.hpp // See the comment at the top of g1MemoryPool.hpp
size_t G1MemoryPoolSuper::survivor_space_committed(G1CollectedHeap* g1h) { size_t G1MemoryPoolSuper::survivor_space_committed(G1CollectedHeap* g1h) {
return survivor_space_used(g1h); return MAX2(survivor_space_used(g1h), (size_t) HeapRegion::GrainBytes);
} }
// See the comment at the top of g1MemoryPool.hpp // See the comment at the top of g1MemoryPool.hpp
...@@ -71,6 +73,8 @@ size_t G1MemoryPoolSuper::survivor_space_used(G1CollectedHeap* g1h) { ...@@ -71,6 +73,8 @@ size_t G1MemoryPoolSuper::survivor_space_used(G1CollectedHeap* g1h) {
// See the comment at the top of g1MemoryPool.hpp // See the comment at the top of g1MemoryPool.hpp
size_t G1MemoryPoolSuper::survivor_space_max(G1CollectedHeap* g1h) { size_t G1MemoryPoolSuper::survivor_space_max(G1CollectedHeap* g1h) {
// This should ensure that it returns a value no smaller than the
// region size. Currently, survivor_space_committed() guarantees that.
return survivor_space_committed(g1h); return survivor_space_committed(g1h);
} }
...@@ -81,6 +85,7 @@ size_t G1MemoryPoolSuper::old_space_committed(G1CollectedHeap* g1h) { ...@@ -81,6 +85,7 @@ size_t G1MemoryPoolSuper::old_space_committed(G1CollectedHeap* g1h) {
size_t survivor_committed = survivor_space_committed(g1h); size_t survivor_committed = survivor_space_committed(g1h);
committed = subtract_up_to_zero(committed, eden_committed); committed = subtract_up_to_zero(committed, eden_committed);
committed = subtract_up_to_zero(committed, survivor_committed); committed = subtract_up_to_zero(committed, survivor_committed);
committed = MAX2(committed, (size_t) HeapRegion::GrainBytes);
return committed; return committed;
} }
...@@ -101,6 +106,7 @@ size_t G1MemoryPoolSuper::old_space_max(G1CollectedHeap* g1h) { ...@@ -101,6 +106,7 @@ size_t G1MemoryPoolSuper::old_space_max(G1CollectedHeap* g1h) {
size_t survivor_max = survivor_space_max(g1h); size_t survivor_max = survivor_space_max(g1h);
max = subtract_up_to_zero(max, eden_max); max = subtract_up_to_zero(max, eden_max);
max = subtract_up_to_zero(max, survivor_max); max = subtract_up_to_zero(max, survivor_max);
max = MAX2(max, (size_t) HeapRegion::GrainBytes);
return max; return max;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册