Skip to main content

Resin

Adding JVM options

Check the method how to add JVM options in the application server environment using Resin. Depending on the Java version, the JVM options to apply may differ. Apply the JVM options for your environment. Apply the options and then restart the application server.

  • Option 1: Add the javaagent parameter by busing the jvm_args property in the resin.properties file.

  • Option 2: Set the -javaagent parameter by adding the <jvm-args> section to the conf/resin.conf or conf/resin.xml file.

Note
  • Through the application server log file and the agent log file, check whether the agent is operating normally or any error occurs. For the location of log files, check the following:

    • Agent: $WHATAP_HOME/logs/whatap-{SERVER_NAME}-{DATE}.log
    • RESIN 4.x: $RESIN_HOME/log/jvm-app-#.log
  • If the agent does not work normally or an error occurs, check the following.

Java 6 to Java 8

resin.properties
jvm_args : -javaagent:{WHATAP_HOME}/whatap.agent-X.Y.Z.jar
resin.conf | resin.xml
<jvmarg>-javaagent:{WHATAP_HOME}/whatap.agent-X.Y.Z.jar</jvm-arg>

Java 9 to Java 15

resin.properties
jvm_args : -javaagent:{WHATAP_HOME}/whatap.agent-X.Y.Z.jar -Djdk.attach.allowAttachSelf=true
resin.conf | resin.xml
<jvmarg>-javaagent:{WHATAP_HOME}/whatap.agent-X.Y.Z.jar</jvm-arg>
<jvmarg>-Djdk.attach.allowAttachSelf=true</jvm-arg>

Java 16 or later

resin.properties
jvm_args : -javaagent:{WHATAP_HOME}/whatap.agent-X.Y.Z.jar -Djdk.attach.allowAttachSelf=true --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED
resin.conf | resin.xml
<jvmarg>-javaagent:{WHATAP_HOME}/whatap.agent-X.Y.Z.jar</jvm-arg>
<jvmarg>-Djdk.attach.allowAttachSelf=true</jvm-arg>
<jvmarg>--add-opens=java.base/java.lang=ALL-UNNAMED</jvm-arg> <!-- Java 17 or later -->
<jvmarg>--add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED</jvm-arg>

Viewing the heap histogram

WhaTap's Java Monitoring provides the function to view the status of heap occupancy objects in the JVM memory (sizes for each object in heap memory). In APP > Instance performance analysis, select the Heap histogram tab.

Java versions 6 to 8 support basic functions without the JVM options. However, for some Java versions, the JVM options must be applied as follows:

  • Java 9 to Java 15

    -Djdk.attach.allowAttachSelf=true
    example
    java -javaagent:{WHATAP_HOME}/whatap.agent-X.Y.Z.jar -Djdk.attach.allowAttachSelf=true -jar {application.jar}
  • Java 16 or later

    -Djdk.attach.allowAttachSelf=true
    --add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED
    example
    java -javaagent:{WHATAP_HOME}/whatap.agent-X.Y.Z.jar -Djdk.attach.allowAttachSelf=true --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED -jar {application.jar}
Note

It does not support Java 5 or earlier and IBM Java.

Starting the monitoring

Once the application server is restarted after configuring all settings, the agents start collecting data. See the following.