Tuesday, February 9, 2010

Built In Java Tools & JProfiler

List Java Processes
[serkans@serkanslnx smartconnect] jps -l
16563 sun.tools.jps.Jps
8765 ReporterGeneratePdf
Getting Thread Dump of a process with the given id

[root@serkanslnx telco]# jstack 1009
Attaching to process ID 1009, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 1.5.0_10-b03

Thread 1079: (state = IN_NATIVE)
- java.lang.UNIXProcess.waitForProcessExit(int) @bci=0 (Interpreted frame)
- java.lang.UNIXProcess.access$900(java.lang.UNIXProcess, int) @bci=2, line=20 (Interpreted frame)
- java.lang.UNIXProcess$1$1.run() @bci=165, line=132 (Interpreted frame)

JVM Arguments for Profiling and Debugging
-Xdebug -Xrunjdwp:transport=dt_socket,address=1980,server=y,suspend=n
OR
-Xdebug -Xrunjdwp:transport=dt_socket,address=1980,server=y,suspend=y

JVM_ARGS and LD_LIBRARY_PATH for JProfiler Debugging
-Xint -Xrunjprofiler:port=8849 -Xbootclasspath/a:/space/tools/jprofiler3/bin/agent.jar
and also
export LD_LIBRARY_PATH=/opt/jprofiler3/bin/linux-x86:$LD_LIBRARY_PATH

No comments:

Post a Comment