How can I get the memory and CPU usage of an external process using Java?

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

How can i do this?

0
source share
2 answers

It depends on the platform, but essentially uses it Runtime.getRuntime()to execute the corresponding command, to output it and analyze it for the necessary data.

+2
source

If I am not mistaken Runtime.getRuntimefor the virtual machine, but not for the physical. What you are asking is getting information about a physical machine (which means a processor).

0

All Articles