Link to home
Start Free TrialLog in
Avatar of pvinodp
pvinodp

asked on

How to monitor a production java process running on linux

I need to monitor a java process. At present I monitor the cpu and memory used by it using top command.
And then for that process_id I log the output of
1. lsof -p ${process_pid}
2. pstack -p ${process_pid}
3. top -n 1 -b -p ${process_pid} -H

But these are not giving me any useful results together. How do i collate useful details from them?

I am aware of some useful tools inside jdk folder, but i cant use them as they are not part of the production server.
Is there any detail provided by jvm and linux OS other than what I have listed above?
Avatar of Sharon Seth
Sharon Seth
Flag of India image

What do you need to monitor , apart from cpu and memory?
Avatar of pvinodp
pvinodp

ASKER

which jar is taking how much memory. what is the memory occupied by a class.
Same details for cpu as well.
SOLUTION
Avatar of Radek Baranowski
Radek Baranowski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pvinodp

ASKER

i am well aware of tools within jdk.
I need to know if there is any help available from jre or linux OS
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pvinodp

ASKER

https://coderwall.com/p/il3h4g:: This link suggest that I start the java process with the arguments. But i need to sniff the production java process which has already started and giving trouble. Moreover jhat is part of jre and not jdk.

Even the second link requires similar process.


let me know if I have wrongly understood.
yes, possibly.

well what you are trying to do can only be achieved by either jconsole or dumping heap/thread dumps with kill -3 <pid> and analyzing it with available tools (Java Heap/Thread dump analyzer from IBM or write parser of your own)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pvinodp

ASKER

thats a lot useful information. thanks all