Troubleshooting Performance and Memory Problems with an HP JVM
When you encounter performance problems, you must first isolate the application that is causing the performance problems. You can stop the Redwood Server application in your application server and monitor system performance to see if the problem is related to Redwood Server.
Once you have determined that Redwood Server is the cause of performance issues, you contact your Redwood support services representative.
To analyse memory-related issues, you can be asked to create a thread or heap dump, also known as Javadump.
When Redwood support services request heap dumps, Redwood recommends you create at least three. The first should be created once the web application has initialized completely, the other at peak usage and the third as soon as response-times are very high. Remember that if you have been asked to create more, you should try to spread them evenly. Note also, that it is easier to analyse heap dumps when the difference in file size is big.
Thread Dumps
Thread dumps contain information about the threads that are active at the time of the dump. With an HP JVM, deadlocks are also printed in a thread dump.
To create a thread dump, you send the JVM process a SIGQUIT
signal.
$kill -3 <pid>
You can use ps
to locate the process ID of the JVM.
note
Ensure the environment variables and JVM parameters listed below for heap dumps are not set, or you will generate heap dumps instead, which are much more voluminous.
Heap Dumps
Heap dumps contain information about all objects that are referenced in memory at the time of the heap dump. This allows you to analyse memory usage and helps detect memory leaks.
note
Heap dumps can get very big and can cause temporary performance issues. You should not create heap dumps repeatedly within a short time-frame.
note
A full GC is performed prior to generating the heap dump.
You have the following options to generate heap dumps:
JVM Parameters
JVM Parameter | Trigger | Format | File Name | Description |
---|---|---|---|---|
-XX:+HeapDump | SIGQUIT | ASCII | java_<pid>_<date>_<time>_heapDump.hprof.txt | Create a heap dump on SIGQUIT |
-XX:+HeapDumpOnCtrlBreak | SIGQUIT | Binary | java_<pid>.hprof.<millitime> | Create a binary heap dump on SIGQUIT |
-XX:+HeapDumpOnOutOfMemoryError | Out of Memory | Binary | java_<pid>.hprof | Create a binary heap dump on OutOfMemoryErrors |
-XX:HeapDumpPath=file | N/A | N/A | N/A | Used in conjunction with -XX:+HeapDumpOnOutOfMemoryError to specify a file name |
-XX:+HeapDumpOnly | SIGVTALRM | ASCII | java_<pid>_<date>_<time>_heapDump.hprof | Create a heap dump only, the thread and trace dumps are suppressed |
M!! Environment Variables
_JAVA_HEAPDUMP
- environment variable to generate heap dumps, equivalent to-XX:+HeapDump
_JAVA_BINARY_HEAPDUMP
- environment variable to get binary (with JVM parameters that generate heap dumps in ASCII)_JAVA_HEAPDUMP_ONLY
- environment variable to generate the heap dump only, the thread and trace dumps are suppressed
The advantage of environment variables resides in the fact that you do not need to change the startup command of the JVM.
Procedure
Creating a Thread Dump
$ kill -3 <pid>
Creating a Heap Dump
$ export _JAVA_HEAPDUMP=1
$ kill -3 <pid>
See Also
onsiteTopic