How to setup Jstack tracing for SUP 2.x
jstack prints Java stack traces of Java threads for a given Java process or core file or a remote
debug server. For each Java frame, the full class name, method name, 'bci' (byte code index)
and line number, if available, are printed. With the -m option, jstack prints both Java and native
frames of all threads along with the 'pc' (program counter). For each native frame, the closest
|native symbol to 'pc', if available. Jstack is part of the JDK that is installed under Sybase.
- This document assumes you have a working SUP environment.
- You have downloaded the PSToolsfrom Microsoft.
- Have Administrator rights to the Operating System and Sybase Unwired Server.
Issue 1 High CPU utilization locking in the CDB.
- User needs to debug high CPU usage.
- User needs to investigate locks in the CDB.
- User needs to investigate hanging SPID
- Look for mlsrv12.exe process and its PID.
- To make it easy to run the jstack create a simple batch file.
-F %MLSRV_PID% >> jstack_mlsvr12.txt
- Make sure you change the PID= with your SPID for mlsrv12.exe.
debug options in Sybase Control Center in Step 2.
Step 2 Configure Sybase Control Center for debugging:
We are now ready to perform the stack trace in Step 3.
Step 3 Running the jStack and gathering a stack trace:
- Capturing the thread processes.
directory where you ran the jstack,batfile you should see the output file
of the lock or hangs and if it is normal or abnormal condition.
capture the processing threads in the Sybase Unwired Server to show if there is any issues
such as locks on the database. In addition the jstacktrack can also show who is active and
how much work the process is doing. This is a very valuable tool to track down hanging
threads and what they are doing.