aspose file tools*
The moose likes Java in General and the fly likes How to get the status and memory  usage in Javsa Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to get the status and memory  usage in Javsa" Watch "How to get the status and memory  usage in Javsa" New topic
Author

How to get the status and memory usage in Javsa

Thirumurugan Sivaji
Greenhorn

Joined: Mar 03, 2009
Posts: 20
Hi,
I have two text fields in my JSP called ipAddress and processName. When I click the submit button I have to find and get the status of the Process and memory usage in bytes and also in percentage for that particular process name.Can anyone give me the Java code for performing the above task that support all Operating System.


Warm Regards,

Thirumurugan Sivaji

Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Thirumurugan Sivaji wrote:Hi,
I have two text fields in my JSP called ipAddress and processName. When I click the submit button I have to find and get the status of the Process and memory usage in bytes and also in percentage for that particular process name.Can anyone give me the Java code for performing the above task that support all Operating System.



Hi Thirumurgan,

The CodeRanch is Not a Code Mill. We can try to help you solve your problems, but we will not provide full solutions. If you want full solutions there are consultancy services you can look into to get the work done.

The question you ask, in particular, is a difficult one, because it will depend on what information each OS provides. The method for getting that information is most likely OS dependent, and may require native code. One approach on Windows would be to call "tasklist.exe" from Runtime.exec(), which provides a list of the running processes and their memory consumption. Parse the results and you should get the answer you are looking for. Other OSes will have different tools, and I am not convinced all versions of Windows have tasklist.


Steve
 
wood burning stoves
 
subject: How to get the status and memory usage in Javsa