RFR (S): 8075288: Remove dictionary NULL check on common path of BlockFreeList methods

Stefan Karlsson stefan.karlsson at oracle.com
Thu Apr 30 08:24:52 UTC 2015


Hi Jungwoo,

On 2015-04-29 23:46, Jungwoo Ha wrote:
> Oops. I meant to copy BUG-8079091
> http://cr.openjdk.java.net/~jwha/8079091/webrev.00/ 
> <http://cr.openjdk.java.net/%7Ejwha/8079091/webrev.00/>
>
>
> On Wed, Apr 29, 2015 at 2:40 PM, Jungwoo Ha <jwha at google.com 
> <mailto:jwha at google.com>> wrote:
>
>     BUG: https://bugs.openjdk.java.net/browse/JDK-8079091
>     Webrev: http://cr.openjdk.java.net/~jwha/8075288/webrev.00/
>     <http://cr.openjdk.java.net/%7Ejwha/8075288/webrev.00/>
>
>     Can someone sponsor this change?
>     I've seen ~3% speed up on DaCapo benchmarks. (results attached on
>     the bug page.)
>

I'm having a hard time believing this claim. Could you provide JVM flags 
that you used so that we can test this?

>     Regardless of the speed up, I think the changes are
>     straight-forward improvement.
>

I agree. This is a nice cleanup, irrespective of any potential 
performance gains.

http://cr.openjdk.java.net/~jwha/8079091/webrev.00/src/share/vm/memory/metaspace.cpp.udiff.html

-BlockFreelist::BlockFreelist() : _dictionary(NULL) {}
+BlockFreelist::BlockFreelist()
+    : _dictionary(new BlockTreeDictionary()) {
+  assert(_dictionary != NULL, "Failed to allocate BlockTreeDictionary");
+}

No need to NULL check CHeapObj allocations, since the JVM will exit if 
it failed to get memory. See AllocateHeap:
   if (p == NULL && alloc_failmode == AllocFailStrategy::EXIT_OOM) {
     vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "AllocateHeap");
   }

Thanks,
StefanK

>
>     --
>     Jungwoo Ha
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20150430/5c3d4103/attachment.htm>


More information about the hotspot-gc-dev mailing list