JProfiler is a tool to profile a JVM in runtime locally or remotely. Its profiling features are mainly in 2 parts which are CPU and memory. In CPU part, it can shows all threads situation in JVM and its state(RUNNING,BLOCKING,WAITING,..) and also traces which part of instruction the thread currently runs. It can show object locking graph to identify a locking problem which is difficult to figure out by normal debugging.In memory part, it collects and shows memory allocation stats, object counts and also traces the methods or classes which do most of memory allocation. Furthermore, it can shows what and when java garbage collector do with current memory consumption as a time-based graph.How to setup?
- Download JProfiler and its evaluation key
- Install JProfiler in your computer.
- Copy JProfiler agent library to a target which you want to do remote profiling. JProfiler agent library is in [JProfiler path]/bin/
- Add an argument in JVM which you want to do profiling. (I use FreeBSD.)-agentpath:/usr/home/tmp/jprofiler6/bin/freebsd-x86/libjprofilerti.so=port=8849
** 8849 is a port for JProfiler client to communicate with its agent. You can change this
if you have firewall, you may need to allow the portipfw add 6000 allow tcp from any to me dst-port 8849 keep-state - Open JProfiler client. -> Start center -> New session tab -> New session button -> select remote -> configure host and port of target jvm -> Start
- Start target JVM. it will pause and wait JProfiler to attach it.
- In JProfiler client, click Attach and OK
Next time I may write about how to setup JProfiler with Eclipse to do local profiling. If you can’t wait, find it in JProfiler help.
** When the evaluation ends, the client still can open but it doesn’t work
I can't wait! I'm helplessly reading the doc right now :P
ReplyDeleteAny idea how to setup remoteconnection using api,
ReplyDeleteie. offlinr profiling
Can you tell the argument in JVM for AIX 7 box to do profile my application for the following setting
ReplyDelete-agentpath:/usr/home/tmp/jprofiler6/bin/freebsd-x86/libjprofilerti.so=port=8849
I am using JProfiler 6 as client in Windows 7 box.
Do you mean there is no -agentpath option in JVM on AIX ? I don't know much about AIX but I think it's a standard option which JVM should have in every versions.
DeleteBTW, I'm not sure if JProfiler provide agent library (libjprofilerti.so) for AIX.
Hi Teerapap, I found the following message in Integration Wizard in client Jprofiler 6, on choosing the 'Application on remote computer' option in Quick Start window.
Delete---------------------------------------------------------------
Integration type: [Generic application]
Selected JVM: IBM 1.6.0 (jit compiler)
Startup mode: Wait for a connection from the JProfiler GUI
(1) Please insert
-Xshareclasses:none "-agentpath:/apps/Softwares/JProfiler/Jprofiler 6/jprofiler6/bin/aix-ppc/libjprofilerti.so=port=8849"
into the start command of your remote application right after the java command.
A remote session named Remote application on 10.80.16.244 will be created that connects to a running instance of the remote application that is started with the modified start command.
-------------------------------------------------------------
Please tell me the which file need to be modified in remote machine. Is server.xml or change the JVM setup found in the WAS admin console screen.
Thanks in Advance
Abhijit
Continued with last reply, I am using JVM given by IBM WAS application server in my remote AIX box.
DeleteThose options are JVM options.
DeleteI guess, it's JVM setup found in the WAS admin console screen.
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete