Lamvuong
asked on
Network usage monitoring, CPU and memory % usage for Java
I know this is a difficult task and that there is no API for it, I have come across a memory usage and cpu program before but it will only monitor the cpu usage of that thread. I was wondering if someone can help me to write a program that will just print out the current CPU percentage usage and memory of the whole pc, and also the current usage of bandwidth. This does not need to be updated regularly but just a once off print at a percise time when the program is executed. Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi Lamvuong,
you can use jni to achive this. or use an external executable which prints the details required to a file. then let ur program read this file and extract the data
Regards,
Bhagyesh
you can use jni to achive this. or use an external executable which prints the details required to a file. then let ur program read this file and extract the data
Regards,
Bhagyesh
ASKER
This was not really the answer i was looking for... The question was clearly stating for java, not c# as someone has already done it in c# so that did not really helped. yeah Bhagyesh JNI is how to do it, but i have no idea how to do it, there is hardly any documentation for these type of things and was wondering anyone have made a JNI code for it.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ManagementScope mScope;
mScope = new ManagementScope("root\\cim
mScope.Connect();
System.Management.ObjectQu
System.Management.ObjectQu
ManagementObjectSearcher srch = new ManagementObjectSearcher(m
ManagementObjectCollection
foreach(ManagementObject m in coll)
{
return (UInt64)m["AvailableBytes"
}