Analyze Metaspace with jcmd VM.metaspace

May 13, 2019

With JDK 11, we added a new diagnostic command to jcmd: VM.metaspace.

This command is very useful to analyze Metaspace consumption. So, lets dive in and use this to revisit our Little WildFly Server That Could from previous articles. We describe the command output and options and how to use it to spot typical waste points.


Sizing Metaspace

March 28, 2019

MaxMetaspaceSize and CompressedClassSpaceSize are our knobs to control Metaspace size.

Now, these parameters can be a tad confusing. For one, there are two of them, and they have subtly different meanings, and they influence each other.

So lets take a closer look. We will explain how those parameters work in detail. Then, we will analyze how much Metaspace a single class on average needs. Finally, we will attempt to derive some rough rules of thumb and also examine what the default behavior is.