Search code examples
jbossjvmjboss7.x

How to read Xmx and Xms values from standalone.conf using CLI?


How can I check the values of Xmx, Xms, and other JVM values, which are in standalone.conf, using the CLI?

[standalone@localhost:9990 /] /core-service=platform-mbean/type=memory:read-resource(recursive=true,proxies=true,include-runtime=true,include-defaults=true)
    {
        "outcome" => "success",
        "result" => {
            "heap-memory-usage" => {
                "init" => 3246391296L,
                "used" => 381631592L,
                "committed" => 3111124992L,
                "max" => 3111124992L
            },
            "non-heap-memory-usage" => {
                "init" => 2555904L,
                "used" => 80962112L,
                "committed" => 90963968L,
                "max" => 1317011456L
            },
            "object-name" => "java.lang:type=Memory",
            "object-pending-finalization-count" => 0,
            "verbose" => true
        }
    }

I need this values: JAVA_OPTS="-Xms3096m -Xmx3096m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true"

Thanks!


Solution

  • You can't. These files, which live outside of the configuration directory, are native batch type files. That's why there is a standalone.conf and a standalone.conf.bat - they are O/S dependent. The CLI interacts with standalone.xml (or the other standalone configuration files) which is the O/S independent configuration.