RFR(S): 8058897 - Unsafe.reallocateMemory() ignores -XX:MallocMaxTestWords setting.
David Holmes
david.holmes at oracle.com
Wed Jan 7 01:46:28 UTC 2015
Hi Christian,
On 7/01/2015 10:12 AM, Christian Tornqvist wrote:
> Hi everyone,
>
> This change makes realloc use MallocMaxTestWords, a debug option used to
> simulate malloc OOM.
diagnostic not debug. :)
> Webrev:
>
> http://cr.openjdk.java.net/~ctornqvi/webrev/8058897/webrev.00/
As this is diagnostic this may not matter much but you now update the
counter before doing the actual malloc/realloc. I don't know how this
gets used in practice so don't know if it might impact anything.
Nit - the test may have a bug:
58 try {
59 unsafe.reallocateMemory(address, 20 * 1000 * 1000 * 8);
60 throw new RuntimeException("Did not get expected OOM");
You might get OOM from the "throw new ..." rather than the reallocate. :)
But for what this is this seems fine. :)
David
>
>
> Bug:
>
> https://bugs.openjdk.java.net/browse/JDK-8058897
>
>
>
> Thanks,
>
> Christian
>
More information about the hotspot-runtime-dev
mailing list