We are trying to profile one of our java application deployed on JBoss AS7 64 bit version.As i found Oracle Performance analyzer(Solaris Studio) being an idle tool we thought of installing it on our RHEL Linux platform.
Linux version: 2.6.18-238.9.1.el5 64-bit version.
The installation was successful and we were able to start all the tools like analyzer solstudio etc. It looks like Inorder to attach to a running java process we should specify the below listed java options
java -Djava.compiler=NONE -Xdebug -Xnoagent -Xrundbx_agent myclass.class
as we use a wrapper the java options are listed in a conf as follows
But we weren't able to start the jboss container after specifying the options here is the error msg encountered during the startup
WARN | wrapper | 2013/11/23 10:38:57 | be suspended. To avoid unwanted shutdowns, timeouts will be
WARN | wrapper | 2013/11/23 10:38:57 | disabled, removing the ability to detect and restart frozen JVMs.
WARN | wrapper | 2013/11/23 10:38:57 | ---------------------------------------------------------------------
STATUS | wrapper | 2013/11/23 10:38:57 | Launching a JVM...
ERROR | wrapper | 2013/11/23 10:38:57 | JVM exited while loading the application.
INFO | jvm 5 | 2013/11/23 10:38:57 | Error occurred during initialization of VM
INFO | jvm 5 | 2013/11/23 10:38:57 | Could not find agent library dbx_agent on the library path, with error: libdbx_agent.so: cannot open shared object file: No such file or directory
FATAL | wrapper | 2013/11/23 10:38:57 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
FATAL | wrapper | 2013/11/23 10:38:57 | There may be a configuration problem: please check the logs.
STATUS | wrapper | 2013/11/23 10:38:57 | <-- Wrapper Stopped
we also verified whether the path set for LD_LIBRARY_PATH is the right one ,Tried providing a symlink in /usr/lib/
ln -s /opt/solarisstudio12.3/lib/dbx/amd64/runtime/libdbx_agent.so libdbx_agent.so
lib used is 64bit ,
Java version: (our application runs on the below mentioned jre not jdk)
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
Could you please review and help us.
Your subject mentions "Performance analyzer". If you're strictly interested in
performance analysis there's one set of answers. If you want to also debug
java using dbx there's a different set of answers.
For both cases ... The debugger and analyzer can treat a java process as either a plain
program or a java program. In the latter case dbx can debug actual java code and collect
can capture JITted code as symbolic java stack traces. To work in java mode the VM has
to be loaded with the appropriate agent.
In order to collect perforamce data by attaching to a process collect has the -p
option. With -p collect/Analyzer depend on dbx to do the attaching and managing of
the process under examination which might be the explanation for why you started
paying attention to dbx.
For performance analysis ... The collect program (which is also started by the
Analyzer GUI) has an option, -p, to attach to a process and collect performance information
The bad news is that in SolStudio 12.3 -p does not support java mode collection (and if
it did it would require it's own special collection agent instead of dbx's agent).
However, you can still use collect -p on a java process but you'll get generic "C" stack
Or you can also embed a collect command in front of the invocation of 'java' in your
For debugging ...
Dbx _can_ attach to a java process which has been started with the agent and will
work in java mode.
I tried to verify things using dbx from SolStudio 12.3 with and
amd64 version of jdk1.7.0_11-b21 on RH 5.4 and the startup options:
-Xdebug -Xnoagent -Xrundbx_agent -Djava.compiler=NONE
I didn't get a "Could not find agentlibrary dbx_agent" message. Instead I got this:
enable_jvmticapabilities() from JVM_OnLoad failed -- NOT_AVAILABLE
Per the recommendation I used these startup options:
-Xdebug -Xnoagent -agentlib:dbx_agent
and things worked.
The above "Run with" error message comes from dbx and for it to work the VM has
to actually succeed in locating and loading the agent .so one way or another so
the above advice is not yet relevant.
So why is the VM not finding the agent?
Some things to check:
- LD_LIBRARY_PATH should only contain a path and not the name of the .so.
- Maybe the startup script overrides LD_LIBRARY_PATH further down?
Ultimately I would use truss, er strace on Linux, and capture the vm's
attempts at searching for the agent library. That will give you a clear
idea of which exact paths the VM looked for the .so in.