You are on page 1of 7

Document 950621.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=hg8pi9cud_4&id=950...

Use VisualVM Tools to Troubleshoot UCM and Observe Performance Problems Occurring in Java Virtual Machine (JVM) (Doc ID 950621.1)
Modified: Aug 2, 2013 Type: TROUBLESHOOTING

In this Document

Purpose
Troubleshooting Steps
Running VisualVM
Use Java 1.6
Using VisualVM to Observe Local JVM
VisualVM Monitor Tab
VisualVM Threads Tab
VisualVM Profiler Tab
Application Snapshots
Using VisualVM to View Remote JVM
Using VisualVM to Monitor JVM Garbage Collection Statistics

APPLIES TO:

Oracle WebCenter Content - Version 10.1.3.3.0 to 10.1.3.5.0 [Release 10gR3]


Information in this document applies to any platform.

PURPOSE

For troubleshooting performance issues in UCM, getting insight into the Java Virtual Machine’s processes and resource usage can be vital in determining the source of performance bottlenecks. VisualVM is a useful tool in reviewing a running
Java processes resources in real time. It allows for getting thread dumps and heap dumps on demand without the need to kill the UCM process. Moreover, it allows for Profiling the CPU or Memory usage of the UCM process, with the capability
to profile just a single class file usage.

VisualVM is a “…visual tool integrating several commandline JDK tools and lightweight profiling capabilities. Designed for both production and development time use, it further enhances the capability of monitoring and performance analysis for
the Java SE platform.”

TROUBLESHOOTING STEPS

Running VisualVM

VisualVM can be downloaded from the web. As of JDK 6 Update 7, Java VisualVM is included with a JDK 1.6 installation. The application is located in the JDK's bin directory, the same location where java.exe is located. The application is
called jvisualvm.exe. This can be run to start VisualVM and requires no installation or special steps.

If using a version of JDK 6 that is prior to Update 7, manually install VisualVM using the following steps. The installation process is just unzipping the downloaded file into a directory:

1. Download VisualVM from https://visualvm.dev.java.net/


2. Unzip the VisualVM download to a directory on the file system, such as C:\VisualVM
3. In the VisualVM "bin" directory, run visualvm.exe. This will start up the VisualVM GUI interface.

Use Java 1.6

UCM should use JDK 1.6 for best results with VisualVM. The JVM version that ships with UCM may be 1.5, which will work with VisualVM but the monitoring tools are fewer and less rich. Java ships the 1.6 JVM with enhanced performance tools
such as jconsole.exe, jvisualvm.exe, and jstatd.exe.

To make sure that UCM starts using a 1.6 JVM, the following line can be added to the intradoc.cfg file in the <ucm-root>/bin directory. Also, if necessary, the JAVA_EXE line can be commented out to force UCM startup to use the Java.exe
specified in the JDK_custom parameter. In this example, the JDK used is that which ships with Oracle JDeveloper.

1 of 7 6/20/2014 8:58 AM
Document 950621.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=hg8pi9cud_4&id=950...

Be sure to use forward slashes in the path to the JDK or JRE installation directory. The same goes for JAVA_EXE if you wish to specify the path to a certain Java executable. If backslashes are used, UCM will revert to using the default JRE
that is shipped with UCM. (The JRE that comes with UCM is located in the directory under the UCM installation path /shared/os/<os-name>.

#JAVA_EXE=java.exe
JDK_custom=C:/Oracle/Middleware/jdk160_05

Using VisualVM to Observe Local JVM

To allow VisualVM to see UCM’s process, the service for the content server must be running as the same user that started VisualVM. In other words, the user that is logged into the machine should be the same user that is used to run the
Windows service.

Once the service is started, the process ID will show up in VisualVM. Double-click on the process to view performance metrics.

VisualVM Monitor Tab

The monitor tab has some useful features, including the “Perform GC” (to force garbage collection) and the “Heap Dump” buttons.

2 of 7 6/20/2014 8:58 AM
Document 950621.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=hg8pi9cud_4&id=950...

VisualVM Threads Tab

The Threads tab allows for thread dumps to be taken as-needed. It also gives continuous updates to the activity taking place in each thread in use by UCM.

VisualVM Profiler Tab

The Profiler tab allows a live insight into the objects created within UCM. The profiler can be run to inspect memory or CPU usage. Using the settings you can create filters so that only certain class activities are traced.

3 of 7 6/20/2014 8:58 AM
Document 950621.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=hg8pi9cud_4&id=950...

Application Snapshots

While using VisualVM, a series of thread dumps and heap dumps can be taken, which are all saved as long as VisualVM remains open. However, if this information needs to be saved, an “Application Snapshot” can be taken, where all thread
dumps and heap dumps can be saved together, then bundled and FTP'd or uploaded for review by other personnel.

Using VisualVM to View Remote JVM

Remote debugging with VisualVM also works but has a more limited set of functions in the interface. For instance, the Profiling tab is not available, and thread and/or heap dumps may not be allowed. Running VisualVM locally on the instance
where UCM is running allows for the most feature-rich use of VisualVM when looking at UCM performance.

To use VisualVM remotely, Java 1.6 comes with a remote debugging tool called jstatd.exe, which is in the same bin directory as java.exe. The jstatd tool “…is an RMI server application that monitors for the creation and termination of
instrumented HotSpot Java virtual machines (JVMs) and provides a interface to allow remote monitoring tools to attach to JVMs running on the local host.” For more on jstatd, refer to the Sun documentation. http://java.sun.com/j2se/1.5.0
/docs/tooldocs/share/jstatd.html

If VisualVM cannot be installed on the system where UCM is running, jstatd can be used to attach remotely. The jstatd service must be started on the system where UCM is running in order for VisualVM to attach to it.

One additional file must be placed somewhere on the UCM host system in order for jstatd to work. The easiest placement of this file is in the bin directory where java.exe and jstatd.exe exist. In this example, that directory is the JDeveloper
JDK directory of C:\Oracle\Middleware\jdk160_05\bin. The file to create is called jstatd.all.policy (with no extension). The text in the file is as follows:

grant codebase "file:${java.home}/../lib/tools.jar" {


permission java.security.AllPermission;
};

4 of 7 6/20/2014 8:58 AM
Document 950621.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=hg8pi9cud_4&id=950...

Once the file is created, jstatd can be started using the following command:

jstatd -J-Djava.security.policy=jstatd.all.policy

The jstatd daemon will run in the shell until a CTRL-Break or CTRL-C kills the process.

With jstatd running on the UCM host system, VisualVM can now connect to the system via Remote Method Invocation (RMI) calls. In VisualVM, go to the File menu and click “Add Remote Host”. Enter the host name where jstatd is running. If the
setup is correct, the Java processes running on the host system will now be visible in VisualVM under the Remote tree in the left panel. At this point, the JVM running IdcServerNT is visible exactly the same as when it is running locally.
However, notice that there are fewer tabs available. The remote attachment does not allow for thread dumps and heap dumps on demand. For this reason, remote attachment through the jstatd service is not as powerful as attaching to a
local JVM.

Using VisualVM to Monitor JVM Garbage Collection Statistics

JVM Garbage collection process at times could be causing performance issues and to monitor that using the default plugin VisualGC need to be installed .
Once this is installed and the VisualVM restarted , selecting pid for the server will show up a new tab Visual GC which will give information for Garbage collection process .
Along with that it will show memory allocated for Young Space (Eden space) , Perm space , Old Space which are key indicators to know / analyze why there are unwanted / excessive GC being invoked .
Based on the details collected from this monitoring tab JVM memory could be assigned accordingly so as to have less number of GC invocations .

5 of 7 6/20/2014 8:58 AM
Document 950621.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=hg8pi9cud_4&id=950...

6 of 7 6/20/2014 8:58 AM
Document 950621.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=hg8pi9cud_4&id=950...

7 of 7 6/20/2014 8:58 AM

You might also like