RFR(S): 7026932: G1: No need to abort VM when card count cache expansion fails

John Cuthbertson john.cuthbertson at oracle.com
Tue Mar 15 10:13:40 PDT 2011


Hi Everyone,

Can I have a couple of volunteers to review the changes for this CR? The 
webrev can be found at: http://cr.openjdk.java.net/~johnc/7026932/webrev.0/

The problem here was that the allocation that is used to expand some 
side tables associated with the hot card cache failed and the JVM 
aborted with an out of C heap memory. For these particular tables an 
expansion is requested when the number of cards hashed to a location in 
these tables goes over a threshold. But it's not critical that the 
expansion succeeds - continuing with the smaller tables is reasonable 
(with perhaps a small performance penalty caused be doing slightly more 
refinement).

The code that does these allocations uses NEW_C_HEAP_ARRAY which calls 
AllocateHeap. AllocateHeap calls os::malloc() followed by 
vm_exit_out_of_memory if the malloc fails. The solution is to call the C 
heap allocation routines directly and perform localized error handling.

I have also added a flag that limits the size to which these table can 
expand to as a fraction of the number of cards for the maximum Java heap 
capacity.

Testing: code modification to simulate out of C heap conditions, the GC 
test suite with expansion artifically disabled; the GC test suite with 
expansion enabled; jprt.

Regards,

JohnC


More information about the hotspot-gc-dev mailing list