How to enable the Java JVisualVM process to collect logging

Version 1
    Share:|

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    Remedy AR System Server


    COMPONENT:

    BMC Remedy Mid Tier - BMC Remedy Action Request System 7.0.01 Patch 002: Corrects various known issues



    QUESTION:

    How to setup and capture Java JVisualVM logging for collecting Thread Dumps or HEAP dumps when the CPU on the Mid Tier is showing the Tomcat process using up too much CPU.


    ANSWER:


    Here are the steps to setup the capture using jvsiaulVM on your Mid Tier server:
    JVM monitoring setup (to use jvisualvm)
    1. Start the JVM with the following additional args (make sure that port 8088 is free on your machine or use another port):

    If there are any issues with the connection failing to establish for Java 7 and above the RMI port parameter needs to be added .

    • -Dcom.sun.management.jmxremote
    • -Dcom.sun.management.jmxremote.port=<PORT-Number>
    • -Dcom.sun.management.jmxremote.rmi.port=<PORT-Number>
    • -Dcom.sun.management.jmxremote.ssl=false
    • -Dcom.sun.management.jmxremote.authenticate=false
    • -Djava.rmi.server.hostname=<JVM-Server-IP-Address>


    Similarly for a Linux environment below :

    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"; export JAVA_OPTS
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=<PORT-Number>"; export JAVA_OPTS
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.rmi.port=<PORT-Number>"; export JAVA_OPTS
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"; export JAVA_OPTS
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"; export JAVA_OPTS
    JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<JVM-Server-IP-Address>"; export JAVA_OPTS

    For,
    -Dcom.sun.management.jmxremote.port=<PORT-Number> and
    -Dcom.sun.management.jmxremote.rmi.port=<PORT-Number>


    the port can be the same or different , If there are security/Firewalll constraints you can keep both the jmx port and RMI port as same .

    2. Launch <jdk>/bin/jvisualvm.exe
    3. Select “File | Add Remote Host…” (skip this step and the next step if jvisualvm was launched on the same machine as the JVM)
    4. Type in the hostname or the IP address in the dialog box
    5. For remote monitoring, use step a. For local monitoring, use step b.
    a. Remote monitoring: The host will show in the navigation tree; select, right-click, choose “Add JMX Connection…”
    b. Local monitoring: Select “File | Add JMX Connection…”
    6. For remote monitoring, type in our JMX port number 8088; for local monitoring, type in “localhost:8088”
    7. The JMX connection will show up in the navigation tree; select and double-click to start monitoring
    8. To change interval to 24 hours from the default: Choose “Tools | Options” and enter 1,440 for Charts Cache
    9. After sufficient data is collected, select the node in the navigation tree, right-click, and choose “Application Snapshot”
    10. The snapshot will show up with timestamp in the navigation tree under the tree “Snapshots”
    11. Select the snapshot, right-click, and choose “Save As…” to save the JVM monitoring data

    To gather a thread dump:
    a) Launch the jvisualvm console and connect to the Tomcat jvm hosting the midtier.
    b)  Click on the Threads tab
    c)  Click on the Thread Dump button.  The Thread dump will be displayed on the console.
    d)  In the lefthand tree, rightclick on the threaddump and select Save As...

    To gather a heap dump:
    a) Launch the jvisualvm console and connect to the Tomcat jvm hosting the midtier.
    b)  Click on the Montitor tab
    c)  Click on the Heap Dump button.  The Heap dump will be displayed on the console.
    d)  In the lefthand tree, rightclick on the heap dump and select Save As...


    Article Number:

    000113497


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles