jbellis / jamm

Java Agent for Memory Measurements
Apache License 2.0
684 stars 125 forks source link

Memoize reflection #39

Closed szegedi closed 4 years ago

szegedi commented 4 years ago

Memoizes slow reflective operations into ClassValue objects. Most notably, creation of a list of accessible, non-primitive Field objects that need to be traversed in measureDeep and countChildren. It also memoizes MemoryLayoutSpecification.sizeOfInstance[WithUnsafe] as both of those also need to retrieve a list of fields.

A separate commit bumps the required version of Java to 7, since that's when java.lang.ClassValue was introduced.

szegedi commented 4 years ago

I'm going to close this, as it's obsoleted by #41