0

I see these metrics:

# 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",} 8.05306368E8
jvm_memory_max_bytes{area="nonheap",id="Metaspace",} 2.01326592E8
jvm_memory_max_bytes{area="nonheap",id="CodeCache",} 1.34217728E8
jvm_memory_max_bytes{area="heap",id="G1 Eden Space",} -1.0
jvm_memory_max_bytes{area="nonheap",id="Compressed Class Space",} 3.3554432E7

I don't understand why i see -1 ?

Nomad Settings:

   jvm:
      ReservedCodeCache: 128
      CompressedClassSpace: 32
      ThreadsCount: 100
      MetaSpace: 64
      MaxMetaSpace: 192
      Xss: 256 
      flags: >-
        -XX:+HeapDumpOnOutOfMemoryError
        -XX:+UnlockDiagnosticVMOptions 
        -XX:NativeMemoryTracking=summary 
        -XX:+PrintNMTStatistics 
        -XX:+UseG1GC 
        -XX:+UseCompressedOops 
        -verbose:sizes
        -Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true
        --add-opens java.base/java.lang=ALL-UNNAMED
    java_xmx: 768
    extra_memory: 50

This happend when migrated to java 17, before on java 8 all metrics were valid and not -1.

tryingHard
  • 1,794
  • 4
  • 35
  • 74
  • 2
    You’re only wondering about the `-1` but not the use of floating point values for memory sizes? Interpretation 1: “minus one means ‘No Limit’”. Interpretation 2: “An unsigned max long has been interpreted as signed value”. Both boil down to the same effective result. – Holger May 25 '22 at 10:04
  • @Holger Thanks. Why there is no limit? Is this a good thing? How Can i set it? Should i set it? – tryingHard May 25 '22 at 10:36
  • 2
    These areas are limited to the maximum total heap size anyway. There’s no reason to have individual maximum sizes. – Holger May 25 '22 at 10:49

0 Answers0