Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java Threads?

Status
Not open for further replies.

SpongeBob1

Programmer
Mar 1, 2002
49
US
Hi,

Does anyone know how to monitor a Java Process? Not ps -ef|grep... Any ideas?

Thanks,
 
Is that SpongeBob from NX?? If so, nice to meet you and hurry up and get the forums back on line?? LOL. IF NOT....please ignore me...FI

moving on to your question: not sure exactly what you want to monitor but if you want to see if the java process is active, then you can trace the system calls with 'truss' or 'trace' (depending what system your on).

grab the pid and do: truss -p $pid

This is truss at a very basic level, so have a look at the man page if you need to delve in any further and of course, you'll need to be root to run truss.

if a process is inactive then you'll get output similar to this:

# truss -p 2018
connect(6, 0x0002CBEC, 16) (sleeping...)

if it busy, then get ready to watch the output scroll faster than you can read it. If this is the case then you can re-direct the output to file and examine at your leisure.

hope this helps?



Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top