Suppose I launched new process in JVM using ProcessBuilder. How can get information about memory used by process and CPU time?
General, problem is this: I have a executable, I need to run it with CPUtime and memory restrictions, I need to set up some callbacks which works on event when CPU or memory restrictions failed. How can I do this in Java?
Thanks in advance
OSHI project could help:
OSHI is a free JNA-based (native) Operating System and Hardware Information library for Java. It doesn't require the installation of any additional native libraries and aims to provide a cross-platform implementation to retrieve system information, such as OS version, processes, memory & CPU usage, disks & partitions, devices, sensors, etc.
The feature you're looking for is:
Process uptime, cpu, memory usage
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.