WildFly JVM Settings: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
=Overview=
=Overview=


JVM settings can be declared in the server's configuration files, as shown below, and are propagated to the server JVMs.  
JVM settings can be declared in the server's configuration files, as shown below, and are propagated to ''server node'' JVMs. In domain mode, the JVM settings for the process controller and host controller JVMs are declared in a different location.


=Configuration=
=Configuration=

Revision as of 01:53, 5 April 2017

Internal

Overview

JVM settings can be declared in the server's configuration files, as shown below, and are propagated to server node JVMs. In domain mode, the JVM settings for the process controller and host controller JVMs are declared in a different location.

Configuration

Standalone Mode

Modify standalone.conf as follows:

    ...
    JAVA_OPTS="-Xms1000m -Xmx2000m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m ..."
    ...

Even if standalone*.xml allows for a <jvm> element, it seems it is not honored when specified. More research is needed on this.

Domain Mode

domain.xml

<domain ...>
    ...
    <server-groups>
        <server-group name="...">
            <jvm java-home="..." 
                    type="SUN|IBM" 
                    env-classpath-ignored="true"
                    debug-enabled="false"
                    debug-options="...">
                <heap size="" max-size=""/>
                <permgen>...</permgen>
                <stack>...</stack>
                <agent-lib>...</agent-lib>
                <agent-path>...</agent-path>
                <java-agent>...</java-agent>
                <jvm-options>
                    <option name="...">....</option>
                     ...
                </jvm-options>
                <environment-variables>...</environment-variables>
                <launch-command>...</launch-command>
            </jvm>
        </server-group>
    </server-groups>
    ...
</server>

Example:

<jvm>
    <heap size="1000m" max-size="2000m"/>
    <jvm-options>
        <option value="-server"/>
        <option value="-XX:MetaspaceSize=256m"/>
        <option value="-XX:MaxMetaspaceSize=512m"/>
    </jvm-options>
</jvm>

host.xml

host.xml allows "named" <jvm> declarations.

<host ..>
    ...
    <jvms>
        <jvm name="jvm-a" ...>
        </jvm name="jvm-b" ...>
        ...
    </jvms>
    ...
</host>

Precedence Rules

Relationship between JVM Settings and Host Controller and Process Controller JVM Settings