Spring Boot JVM Metrics, Why some values of jvm_memory_max_bytes is -1

584 Views Asked by At

I think the problem is same as G1 Garbage Collector: Why survivor space is -1.

But the questioner's question occurred while migrating to jdk17, my case happened on jdk8.

My /actuator/prometheus output:

# HELP jvm_memory_max_bytes The maximum amount of memory in bytes that can be used for memory management
# TYPE jvm_memory_max_bytes gauge
jvm_memory_max_bytes{area="heap",id="G1 Survivor Space",} -1.0
jvm_memory_max_bytes{area="heap",id="G1 Old Gen",} 1.073741824E9
jvm_memory_max_bytes{area="nonheap",id="Metaspace",} -1.0
jvm_memory_max_bytes{area="heap",id="G1 Eden Space",} -1.0
jvm_memory_max_bytes{area="nonheap",id="Code Cache",} 2.5165824E8
jvm_memory_max_bytes{area="nonheap",id="Compressed Class Space",} 1.073741824E9

What's the meaning of -1? Why did this happen?

0

There are 0 best solutions below