Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - How can i monitor Memory and CPU usage of other process

Tags:

java

I need to get info for memory and CPU usage of some process running on the machine (not the Java process).

How can I do that?

[I reopened the thread after it was closed as a duplicate of other thread. The other thread is not relevant, it is not talking about receiving information of other specific process].

like image 201
Erik Sapir Avatar asked Nov 13 '22 17:11

Erik Sapir


1 Answers

Following are the choices for different platforms

  1. Sigar
  2. JavaSysMon
  3. Oshi

Another possible way could be to call Native application for Monitoring from java using ProcessBuilder or RunTime java classes

like image 67
Manish Singh Avatar answered Mar 06 '23 17:03

Manish Singh