Problem
The Java Memory Assistant agent fails to start with:
com.sap.jma.Agent#ERROR: JavaMemoryAssistant cannot start
java.util.NoSuchElementException: The option 'jma.check-interval' is unknown
When using:
JBP_CONFIG_JAVA_MEMORY_ASSISTANT: '{enabled : true, agent: { thresholds : { heap: "80%" }, heap_dump_folder: /home/vcap/, check_interval: 5m } }'
Root Cause
The Go buildpack emits JVM system properties with hyphens, but the JMA agent expects underscores (matching the original Ruby buildpack):
| Go (wrong) |
Should be |
-Djma.check-interval |
-Djma.check_interval |
-Djma.max-frequency |
-Djma.max_frequency |
-Djma.heap-dump-folder |
-Djma.heap_dump_folder |
-Djma.log-level |
-Djma.log_level |
-Djma.threshold.* |
-Djma.thresholds.* |
Additionally, heap_dump_folder set via config is silently ignored (always defaults to $PWD).
Problem
The Java Memory Assistant agent fails to start with:
When using:
Root Cause
The Go buildpack emits JVM system properties with hyphens, but the JMA agent expects underscores (matching the original Ruby buildpack):
-Djma.check-interval-Djma.check_interval-Djma.max-frequency-Djma.max_frequency-Djma.heap-dump-folder-Djma.heap_dump_folder-Djma.log-level-Djma.log_level-Djma.threshold.*-Djma.thresholds.*Additionally,
heap_dump_folderset via config is silently ignored (always defaults to$PWD).