RFR (XXS) 8008964 - Thread::_metadata_handles uses 1 KB per thread
ioi.lam at oracle.com
Wed Jun 19 09:40:15 PDT 2013
Please review a very small fix:
Bug: NPG: Memory regression: Thread::_metadata_handles uses 1 KB per thread.
Thread::_metadata_handles is a GrowableArray that keeps class metadata
alive during class redefinitions. See metadataOnStackMark.cpp.
The initial allocation size is 300 elements per Thread. This seems
Summary of fix:
I changed the initial allocation of 300 elements to 30 elements.
I added traces in a private build and found that the max array length
is usually around 100, and most of the threads never use more than
metadata_handles expanded from [ 0] = 34 time(s) // a total 34
threads have been created
metadata_handles expanded from [ 30] = 9 time(s)
metadata_handles expanded from [ 60] = 2 time(s)
_metadata_handles_max_len = 114
metadata_handles expanded from [ 0] = 156 time(s)
metadata_handles expanded from [ 30] = 19 time(s)
metadata_handles expanded from [ 60] = 4 time(s)
_metadata_handles_max_len = 104
So it looks like we can safely reduce the initialize of
Thread::_metadata_handles from 300 to 30,
a saving of 2160 bytes per live Thread (64-bit VM) or 1080 bytes
for 32-bit VM.
UTE (vm.runtime.testlist, vm.quick.testlist,
More information about the hotspot-runtime-dev