aspose file tools*
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 Spring in Action this week in the Spring 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Measure Free Memory/CUP using Java