RFR 8062116: JVMTI GetClassMethods is Slow

Jeremy Manson jeremymanson at google.com
Thu Oct 30 17:02:00 UTC 2014


There's a significant regression in the speed of JVMTI GetClassMethods in
JDK8. I've tracked this down to allocation of jmethodids in a tight loop.
The issue can be addressed by preallocating enough space for all of the
jmethodids when starting the operation and not iterating over all of the
existing jmethodids when you allocate a new one.

A patch is here:

http://cr.openjdk.java.net/~jmanson/8062116/webrev.00/

A reproducible test case can be found here:

http://cr.openjdk.java.net/~jmanson/8062116/repro/

It's a benchmark, though: I have no idea how to turn it into a test.

For whoever reviews it: can you explain to me why it is okay that this code
reuses jmethodIDs (in JNIMethodBlock::add_method?  I can imagine a lot of
problems stemming from accidental reuse.

Jeremy


More information about the hotspot-runtime-dev mailing list