26 Jul 2024 11:31 AM
I was talking to a Websphere administrator and I was wondering about this. He said, "56GB allocated to JVM Heap." I expected this to match the Dynatrace metric "JVM heap memory pool committed bytes," but that metric shows 25.8GiB. Incidentally, a similar metric, "JVM heap memory max bytes," shows 70.5GiB.
Does anyone have any ideas about this discrepancy?
Toshimasa Shirai.
Solved! Go to Solution.
26 Jul 2024 01:37 PM - edited 26 Jul 2024 01:38 PM
Hi Shirai,
Yes JVM metrics can be complex and confusing.
- Heap committed memory is the memory the JVM has asked to the OS.
- Heap max memory is the maximum size of the heap. This maps to the Xmx or MaxRAMPercentage JVM flags.
Why committed is lower than max? It's normal, as the JVM tries to allocate memory only when it's needed:
- the JVM heap gets committed at the startup based on the initial heap size, which you can control with the Xms flag.
- when the JVM heap pressure rises (e.g. GC time goes over the JVM target overhead), the JVM inflates the heap to decrease the GC pressure. So this means more heap gets committed (and then used).
Notice also that the max heap sometimes is lower than the actual JVM Xmx flag. This again is due to the fact that the JVM allocates memory incrementally, and - depending on the GC - it can advertise a lower value.
How about the 56GB allocated? The answer is another question - what does the admin actually mean by allocated? Which metric is he talking about? It's K8s requests, or what...
30 Jul 2024 02:29 AM
Hi stefanodoni-san.
Thank you for your reply.
This Websphere is running on a VMware virtual host.
I understand your explanation about "JVM heap memory pool committed bytes".
Let me talk about the metric "JVM heap memory max bytes".
In the Websphere process Properties and tag, in the Command line args, there is a description of "Xmx57344m". I understood that this value matches the metric "JVM heap memory max bytes". But actually, the metric shows 70.5GiB.
30 Jul 2024 05:15 AM
Hello @Shirai
It seems you mistakenly selected the sum aggregation instead of max.
Max: Represents the maximum amount of memory (in bytes) that can be used for memory management. Its value may be undefined. The maximum amount of memory may change over time if defined. The amount of used and committed memory will always be less than or equal to max if max is defined. A memory allocation may fail if it attempts to increase the used memory such that used > committed even if used <= max would still be true (for example, when the system is low on virtual memory).
Regards,
Babar
30 Jul 2024 10:52 AM
Hi @Babar_Qayyum-san.
In this case, I found that I should use "Maximam" instead of "Sum". Thank you for your comment.