RFR (XS): 8014405: G1: PerRegionTable::fl_mem_size() calculates size of the free list using wrong element sizes

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Thu May 16 09:54:25 UTC 2013

Looks good.
Ship it!

Thomas Schatzl skrev 15/5/13 10:22 AM:
> Hi all,
>    can I have reviews for the following change?
> It fixes the memory usage calculation for the G1 fine remembered set
> free list. Previously it summed up only sizes of the PerRegionTable
> object instances, missing out on memory allocated on the heap.
> bugs.sun.com:
> http://bugs.sun.com/view_bug.do?bug_id=8014405
> https://jbs.oracle.com/bugs/browse/JDK-8014405
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8014405/webrev/
> Testing:
> jprt (which runs the unit tests)
> The main patch is the one-liner in heapRegionRemSet.cpp,
> PerRegionTable::fl_mem_size().
> The other changes add support code for unit testing: note that since
> PerRegionTable is a private class, and I preferred to not make it
> public, the test invocation is funneled through the new
> HeapRegionRemSet::test_prt() method. Which I think is okay, since
> PerRegionTable is a component of HeapRegionRemSet.
> This test method is then invoked by the code in jni.cpp.
> The test itself is straightforward: allocate a PerRegionTable instance,
> free it to put it on the free list, and compare the sizes reported by
> the PerRegionTable instance and the PerRegionTable::fl_mem_size()
> method.
> Some nits: Since there is no way to clean up a PerRegionTable instance
> (and the original code never does), if you run the unit tests, this may
> be considered a memory leak.
> Properly cleaning up would require quite a few additions to other
> classes though so I did not implement it just for the test. If you
> consider this important, I will add this, but it seemed that this added
> a lot of noise to the one-line patch.
> Thanks,
>    Thomas

More information about the hotspot-gc-dev mailing list