Skip to content

Fix JMA agent property names: use underscores not hyphens #1265

@stokpop

Description

@stokpop

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions