Abstract
A Java virtual machine (JVM) typically manages large amounts of class metadata (e.g. class descriptors, methods, byte codes) in main-memory. In this paper, we analyze the impact of metadata memory management on garbage collection costs in an industrial-strength JVM. We show that, for most applications in the latest DaCapo benchmark suite, the tracing of class metadata accounts for a significant part of full collection time.We propose a novel approach to metadata memory management based on metaspaces and on a linkset graph. Metaspaces store class metadata segregated by their class loader and keep an exact record of references from class metadata to the heap. The linkset graph summarizes what metaspaces reference others via resolved symbolic links. Metaspaces allow en masse reclamation of the storage allocated to classes defined by a class loader when this class loader becomes unreachable. The linkset graph eliminates the need to trace references between metadata to determine the liveness of classes and of the heap objects they refer to.This reduces the number of visited references in class metadata to less than 1% of the original amount and cuts down tracing time by up to 80%. Average full heap collection time improves by at least 35% for all but one of the Dacapo benchmarks, and by more than 70% for six of them.Metaspace-based management of class metadata also extends well to multi-tasking implementations of the JVM. It enables tasks to unload classes independently of other tasks.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.