jvmheap-memoryjstat

Metaspace utilization of JVM


I am facing issue with my application which runs in a docker. Out of blue it crash after 30 minutes. As my application deals which cache so first suspect is the memory utilization . I googled and find out using jstat -gcutil command we can monitor heap space utilization .

I ran the command with the start of application and for it showed Metaspace utilization as 98% which is quite odd.

So my question is , is this utilization showing that my application is using 98% of OS memory for the JVM process or 98% of OS memory is available for JVM ?


Solution

  • It shows the current Metaspace occupancy relative to the current Metaspace capacity, i.e.

        used / capacity
    

    Metaspace used, capacity, committed and reserved values are illustrated in this answer.

    This is a rather useless metrics since Metaspace can grow and shrink during an application lifecycle.