Java's solution to sigar problems, javasigar
This is an open-source tool Sigar.
Official Website: http://sigar.hyperic.com/
API: http://www.hyperic.com/support/docs/sigar/index-all.html (because it is English, English is not good can use Google's browser translation function, directly converted to simplified Chinese for reading)
Sigar (System Information Gatherer And Reporter) is an open-source tool that provides cross-platform System Information collection APIs, implemented by C language. Information that can be collected includes:
1. CPU information, including basic information (vendor, model, mhz, cacheSize) and statistical information (user, sys, idle, nice, wait)
2. file system information, including Filesystem, Size, Used, Avail, Use %, and Type
3. event information, similar to Service Control Manager
4. Memory information, total number of physical memory and swap memory, usage, and remaining amount; RAM size
5. network information, including network interface information and network route information
6. process information, including the memory, CPU usage, status, parameters, and handle of each process
7. IO information, including IO status and read/write size
8. service status information
9. system information, including the operating system version, system resource restrictions, system running time, load, and JAVA version information.
First we need to first download the sigar package, my downloaded package name: hyperic-sigar-1.6.4
In the running process, we need to prepare
1. Copy the log4.jar and sigar. jar packages to the lib. (If we only perform this step and start running the program, the following situation will occur [in windows])
Solution:
Copy the sigar-x86-winnt.dll file to the bin directory of the java jdk.