Provide a counter of allocated memory
chlunde opened this issue · comments
Micrometer has a metric jvm_gc_memory_allocated_bytes_total
. This is very useful because it provides the total number of allocated bytes, which can be used to calculate actionable stable metrics like "average bytes garbage produced per HTTP request"
It seems a bit tricky to get right, you need to listen to GC events for young gen:
This would be the same as jvm_memory_pool_allocated_bytes_total{pool="Eden Space"}
- but beware of the pool name and GC implementation.