Last week I presented a talk on the subject of Java Class Metadata at FOSDEM 2018 in the Free Java Room. In my presentation I explained:
- What Java Class Metadata is
- Why it helps to know about it
- What you might do to measure it and reduce the impact of the metadata's footprint on your Java application
The "too long -- didn't read" summary is:
- It's the model of the loaded class base that Java retains at runtime in order to dynamically load, link, JIT compile, and execute Java code.
- Different design choices you make when writing your code can significantly expand or contract the amount of metadata Java needs to retain.
- The JVM can give you a breakdown of metadata storage costs for individual structures that model each loaded class, allowing you to weigh and compare the costs of alternative designs.
The video of the talk has been put online by the FOSDEM team. It was limited to 25 minutes, which is enough to get you started, but not enough to explain how to do really fine analysis and tuning. As promised at the start of the talk, I have now published the FOSDEM slides plus the original 4 articles from which the talk was derived. The articles provide an introduction to the topic along with a detailed explanation of how to measure and analyze the JVM stats. Example analyses are included based on the Wildfly code base along with full reference materials listing all of the available stats with advice on how to interpret them.
Please check it out!
Resources: