1.1 --- a/src/share/vm/services/g1MemoryPool.cpp Fri Dec 04 07:44:41 2009 -0500 1.2 +++ b/src/share/vm/services/g1MemoryPool.cpp Mon Dec 07 14:22:34 2009 -0500 1.3 @@ -40,7 +40,7 @@ 1.4 1.5 // See the comment at the top of g1MemoryPool.hpp 1.6 size_t G1MemoryPoolSuper::eden_space_committed(G1CollectedHeap* g1h) { 1.7 - return eden_space_used(g1h); 1.8 + return MAX2(eden_space_used(g1h), (size_t) HeapRegion::GrainBytes); 1.9 } 1.10 1.11 // See the comment at the top of g1MemoryPool.hpp 1.12 @@ -54,12 +54,14 @@ 1.13 1.14 // See the comment at the top of g1MemoryPool.hpp 1.15 size_t G1MemoryPoolSuper::eden_space_max(G1CollectedHeap* g1h) { 1.16 + // This should ensure that it returns a value no smaller than the 1.17 + // region size. Currently, eden_space_committed() guarantees that. 1.18 return eden_space_committed(g1h); 1.19 } 1.20 1.21 // See the comment at the top of g1MemoryPool.hpp 1.22 size_t G1MemoryPoolSuper::survivor_space_committed(G1CollectedHeap* g1h) { 1.23 - return survivor_space_used(g1h); 1.24 + return MAX2(survivor_space_used(g1h), (size_t) HeapRegion::GrainBytes); 1.25 } 1.26 1.27 // See the comment at the top of g1MemoryPool.hpp 1.28 @@ -71,6 +73,8 @@ 1.29 1.30 // See the comment at the top of g1MemoryPool.hpp 1.31 size_t G1MemoryPoolSuper::survivor_space_max(G1CollectedHeap* g1h) { 1.32 + // This should ensure that it returns a value no smaller than the 1.33 + // region size. Currently, survivor_space_committed() guarantees that. 1.34 return survivor_space_committed(g1h); 1.35 } 1.36 1.37 @@ -81,6 +85,7 @@ 1.38 size_t survivor_committed = survivor_space_committed(g1h); 1.39 committed = subtract_up_to_zero(committed, eden_committed); 1.40 committed = subtract_up_to_zero(committed, survivor_committed); 1.41 + committed = MAX2(committed, (size_t) HeapRegion::GrainBytes); 1.42 return committed; 1.43 } 1.44 1.45 @@ -101,6 +106,7 @@ 1.46 size_t survivor_max = survivor_space_max(g1h); 1.47 max = subtract_up_to_zero(max, eden_max); 1.48 max = subtract_up_to_zero(max, survivor_max); 1.49 + max = MAX2(max, (size_t) HeapRegion::GrainBytes); 1.50 return max; 1.51 } 1.52