This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Measure Free Memory/CUP using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Measure Free Memory/CUP using Java" Watch "Measure Free Memory/CUP using Java" New topic
Author

Measure Free Memory/CUP using Java

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
I want to measure Free Memory and Free CUP available on a given time using Java.

I know that there is not cross platform solution for it and I need this for Windows Platform only.

Anybody has C/C++ code or DLL that I can call from Java?

Any other solutions?


My blood is tested +ve for Java.
Aryan Khan
Ranch Hand

Joined: Sep 12, 2004
Posts: 290

Have you tried


Ahmad


OCP/MCP/SCJP/SCWCD/IBM XML/SCMAD/SCEA-1
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
I found following details in Java API:

Runtime.freeMemory(): Returns the amount of free memory in the Java Virtual Machine.
Runtime.maxMemory(): Returns the maximum amount of memory that the Java virtual machine will attempt to use.
Runtime.totalMemory(): Returns the total amount of memory in the Java virtual machine.

They are JVM sepcific. They are not dealing with the System Memory.
Aryan Khan
Ranch Hand

Joined: Sep 12, 2004
Posts: 290

Maybe your answer.
http://forum.java.sun.com/thread.jspa?threadID=425258&messageID=1891830
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

What about using the JVMPI?

JVMPI - The Old Java Virtual Machine Performance Interface

Cheers!

-Cameron McKenzie
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Measure Free Memory/CUP using Java
 
Similar Threads
Java Quotes
How to get CPU and Memory idle values using Java?
compare java with others
java programs run slower than VB
Size of Objects in Memory