Sunday, April 29, 2012

Production Performance tuning

Go to unix location where tomcat is running

su user pasword
bash

cd usr/jdk/bin
# To know the java apache process pid
ps -ef|grep java

JMap:
jmap -histo pid > output.txt
gives
number of instance size in byte classname
----------------------------------------
-----------------------------------------
total instance size in byte total class

jmap -heap pid

eden space(heap) usage -old generation (already used object %)
new genaration % -This is allcated at run time

jmap heapdump filename --> to get the heap dump .
We can download it locally and the checkwith heapdump walker.

Jconsole:
Jconsole will give 
-Thread memory usage
- CPU consumption
-Thread names and their staus
 -Perform GC

It will ask to analyse local and remote application.
One thing here is we will not be able to drill down  here.

Jthreadstack:
jthreadstack -pid
Gives all the thread and their state
        -runnable
        -waiting
        -blocked
thread dump using jstack

jstack -l <process_id> > thread_dump.txt

No comments:

Post a Comment