RFR: 8130681: Overlapping commits no longer break NMT.

Coleen Phillimore coleen.phillimore at oracle.com
Sat Sep 19 02:30:47 UTC 2015


Max,

This change looks good!  Thank you for figuring out the NMT code for 
tracking mmap reservations and commits, in order to make the simplest 
fix in the end.  Too bad we don't have more NMT bugs.  :)

The test looks good also.   But just one question:

   57         wb.NMTCommitMemory(addr + 0*size, 3*size); // [       ]


I believe this call uses the mtTest tag so that you can verify the 
memory sizes in the test.  Can you confirm?

Thanks,
Coleen

On 9/17/15 3:57 PM, Max Ockner wrote:
> Hello all,
>
> Please review this small(?) change to the way committed memory regions 
> are tracked with NMT.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8130681
> Webrev:  http://cr.openjdk.java.net/~mockner/8130681/
>
> Summary:
>
> Previously it was possible to commit a region which overlapped in 
> other regions in a way that was not tracked. If a committed region 
> overlapped with, but was not equal or adjacent to an existing 
> committed region, an assert would fire. This is what we saw in the 
> kitchensink failure.  Instead of throwing an error, we would rather 
> simply track whatever memory operations occur.  If something illegal 
> happens, we can assume it will be caught in the system directly in 
> charge of memory transactions. We can't expect to catch bad memory 
> transactions in NMT, because NMT is not always on.
>
> In this fix, the assert has been replaced with code that ensures the 
> target region gets recorded as committed. The region is first 
> uncommitted, which uncommits any region which is completely contained 
> in the target region, and truncates any region which partially 
> overlaps the target region.
> Then the region is added to the linked list of committed memory regions.
>
> Testing:
> rbt with
> platforms: linux-x64,windows-x64
> testlists: noncolo.testlist -atk quick
>            hotspot/test/:hotspot_jprt,
>            jdk/test/:jdk_lang
> args: -XX:NativeMemoryTracking=detail
>
> A new test has been added for the scenario where two disconnected 
> memory regions are committed and a third region, partially overlapping 
> each of the other two regions, is committed. The test verifies that 
> the total amount of committed memory is correct at each step.
>
> Thanks,
> Max
>



More information about the hotspot-runtime-dev mailing list