Took
up the job to profile the application I am working on. As WAS Liberty
is my favourite app server, wanted to do the profiling on that only.
Tried
various tools like VisualVM, JProfiler etc. But even after lot of
search couldn't find a good page describing how to enable the
application for profiling. Looks like some JMX port
configuration is required, didn't check further.
Then
tried IBM Heath Center. Initially I was bit sceptical as a related IBM
tool - 'Support assistant' is very heavy and had bad experience with
it in the past.
But
I was pleasantly surprised the way IHC was so easy to install and
configure. And good thing, it works with IBM JDK out of the box :)
So
below are the steps:
1)
Install 'Health Center'
Install
in Eclipse by using the update site:
http://public.dhe.ibm.com/software/websphere/runtimes/tools/healthcenter/
There
are other ways which are specified here:
https://www.ibm.com/developerworks/java/jdk/tools/healthcenter/getting_started.html
2)
Enable the application we need to profile, in our case the Liberty
server.
In
the Eclipse Liberty Server project, edit the jvm.options
file, add following lines:
-Xhealthcenter:port=1973
-agentlib:healthcenter
Start
the server. In the startup log you should see:
INFO:
Health Center agent started on port 1973.
Port can vary as per your setup
3)
Connect the health center
Open
the HC perspective: Window -> Open Perspective > Health Center
Status Summary
File
-> New Connection...' . Specify the port mentioned in the log.
Start
using the application and the agent will start collecting the
information and display in neat interface.
1 comment: