I’m currently looking for a query that would return the used heap-size after a full GC run occured.
The goal is to suggest a calculated value for the -XmxN
parameter, based on the return value I am looking for.
I know of the following queries:
1. jvm_memory_usage_after_gc_percent
2. jvm_gc_memory_allocated_bytes_total
3. jvm_gc_pause_seconds_sum
AFAIK:
- only returns the percentage of the long-lived heap
- would return an increment for the increase of the young generation
- gives me the pause time at a certain time
Is it just a matter of adding 1. and 2. together (while doing the necessary conversion), to get to my desired value of the used heap after a full GC?
Or is there a different approach, maybe using the 3rd query to get a timestamp of the last full GC? This would allow me to query the used-heap using the given timestamp.
Help is very much appreciated as I’m currently writing a paper about memory management.