diff -r 7df3acc815a7 -r 5bb45ed999ee hotspot/src/share/vm/runtime/os.cpp --- a/hotspot/src/share/vm/runtime/os.cpp Fri Nov 16 09:59:08 2012 +0100 +++ b/hotspot/src/share/vm/runtime/os.cpp Fri Nov 16 09:19:12 2012 -0500 @@ -582,7 +582,9 @@ // if NULL is returned the calling functions assume out of memory. size = 1; } - + if (size > size + space_before + space_after) { // Check for rollover. + return NULL; + } NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); u_char* ptr = (u_char*)::malloc(size + space_before + space_after);