I have conected tomcat(8GB heap memory is allocated) to visualvm. In visualvm, Under the tab sampler -> memory , Total allocated memory is shown as 17GB(18470717672 bytes). But only 8GB is allocated for tomcat heap memory. In monitor tab its showing the allocated heap size as 8GB (8589934592 bytes) correctly. Please clarify why Total allocated memory is shown as 17GB in sampler tab?
Total allocated memory in sampler shows how much memory was allocated for objects created during your sampling. Some of those objects were already garbage collected and no longer use any memory.
Used shows how much heap memory is currently occupied by objects which were allocated but have not yet been garbage collected.
Size shows how much heap memory is allocated to JVM. This space can be immediately used to allocate new objects.
Max shows how much Size can grow. JVM will not request more memory from operating system. It will throw OutOfMemoryError if new objects "do not fit".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With