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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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: 3041
    
    4

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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to get the status and memory usage in Javsa
 
Similar Threads
How to read memory usage for process running in Linux,
CPU usage and memory usage by processes
memory usage per process
Using Tomcat 6 and the APR to monitor Server resources
java.exe in Task Manager