• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How to get the status and memory usage in Javsa

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic