Hi! I've been trying to get YourKit build 449 to work on Red Hat Enterprise Linux ES release 3. The dependencies are fine when using the GCC2.9 plugin:
libltdl.so.3 => /usr/lib/libltdl.so.3 (0x4004f000)
libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x40057000)
libc.so.6 => /lib/i686/libc.so.6 (0x40099000)
libdl.so.2 => /lib/libdl.so.2 (0x401d3000)
libm.so.6 => /lib/i686/libm.so.6 (0x401d6000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x401f8000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
Somehow profiling just won't start. The JVM loads the plugin but it just doesn't log anything. I can profile the same application on Win32 with the same setup. Here's output from my JVM:
[x@y]$ java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
[x@y]$ java -Xrunyjpagent:help
YourKit Java Profiler 3.1.1 #449 agent usage: -Xrunyjpagent[:help]|[:<option>, ...]
Any hints to get the plugin work? Unfortunately the solution is not to upgrade a newer system :)
Build 449 and GCC 2.9 support
-
- Posts: 1626
- Joined: Tue Aug 10, 2004 7:52 pm
-
- Posts: 4
- Joined: Tue Nov 23, 2004 8:38 am
I'm using the startup script that comes with Tomcat. I have appended the following to CATALINA_OPTS1. What is the command line you are using to launch JVM with profiler agent?
-Djava.awt.headless=true -Xrunyjpagent:onexit=memory,dir=/home/matiasm/debug
If I look process listing the parameter seems to go to JVM as it should.
matiasm 27560 1 0 23:09 pts/0 00:00:03 /www/javakehitys/j2sdk1.4.2_04/bin/java -Xms64m -Xmx64m -Djava.awt.headless=true -Xrunyjpagent onexit=memory,dir=/home/matiasm/debug -Djava.endorsed.dirs=/www/javakehitys/tomcat/common/endorsed -classpath /www/javakehitys/j2sdk1.4.2_04/lib/tools.jar:/www/javakehitys/tomca
From catalina.out I found2. What is the JVM output produced by this command line?
[YourKit Java Profiler 3.1.1 #449] Listening on port 10000...
And it is really listening
[x@y logs]$ netstat -lnp|grep 10000
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 **:10000 0.0.0.0:* LISTEN 27560/java
The mysterious thing is that the plugin just won't write any output to the debug directory. File permissions should be ok.
-
- Posts: 1626
- Joined: Tue Aug 10, 2004 7:52 pm
Please try to launch very simple sample application from $YJP_HOME/samples/sample2 directory. It should create memory snapshot in your home directory.
If everything works, then I see only one possible problem:
You are using onexit=memory option and Tomcat server is not properly shutted down (perhaps kill -9 is used). Have you tried to connect to running Tomcat from profiler UI and capture memory snapshot?
If everything works, then I see only one possible problem:
You are using onexit=memory option and Tomcat server is not properly shutted down (perhaps kill -9 is used). Have you tried to connect to running Tomcat from profiler UI and capture memory snapshot?
-
- Posts: 4
- Joined: Tue Nov 23, 2004 8:38 am
That was it. The Tomcat process died too soon and had no time to write any debug output.You are using onexit=memory option and Tomcat server is not properly shutted down (perhaps kill -9 is used). Have you tried to connect to running Tomcat from profiler UI and capture memory snapshot?
The situation I'm trying to figure out is a little bit trickier. Does the onexit option work if JVM crashes? It's a bit awkward if I must poll the server constantly before the crash happens.
Thank you for your help!
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
-
- Posts: 4
- Joined: Tue Nov 23, 2004 8:38 am
Actually the Java application doesn't crash. The application I'm debugging is known to leak memory. Eventually JVM runs out of memory and crashes (the Java application tries to allocate more and more memory but it can't because the heap is full). I'll try to get a log file for you when JVM crashes again.