aspose file tools*
The moose likes Linux / UNIX and the fly likes Get memory usage of a pid.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Get memory usage of a pid...." Watch "Get memory usage of a pid...." New topic
Author

Get memory usage of a pid....

J.D. Thompson
Greenhorn

Joined: Mar 08, 2006
Posts: 28
I have an application, called BASE, running on a Unix machine. I have second application, called TESTER, running on a Windows machine. TESTER provides load testing for BASE.

Is there a way, from within TESTER, to use Java to get the CPU Usage and memory footprint of BASE from UNIX remotely?

Thank you for your advice and response in advance!

JD
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

Hmmmm. I suppose it depends on what you're doing and how you're doing it. I've done load testing using HttpUnit or one of its friends, but the actual statistics were in terms of how many responses/second it could get. Which was the ultimate metric, but obviously isn't fine-grained enough to pinpoint backend bottlenecks.

For general /proc information reading on a remote machine, you'd pretty much have to have a server process that read the stats localy and presented them to a network requester (client app). Some possibilities on this might range from simple SNMP up to the expensive commercial tools such as CA or IBM.


Customer surveys are for companies who didn't pay proper attention to begin with.
J.D. Thompson
Greenhorn

Joined: Mar 08, 2006
Posts: 28
Tim,

Thank you very much for the well thought out response!!!

I was afraid that might be the case. My boss does not want me to run a server-app to collect the info as she does not want anything that would potentially affect the testing results from BASE.

I am afraid that I will have to use something like JConsole on the same machine as the TESTER program is running and manually record the values. I was hoping for something more elegant.

SNMP would work just fine but BASE is not SNMP compliant right now.

Again, thank you so very, very much for taking time out of your day to provide a quality response!!!

Take care!

JD
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

JConsole can measure on a remote machine. I'd forgotten about it, but as of Java 5, the JVM has extensive built-in JMX support, which is what JConsole uses.

I'd been thinking more along the lines of raw machine resource consumption, not just what's going on inside the JVM. JConsole can measure the JVM's processes quite well.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Get memory usage of a pid....