Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHYSICAL MEMORY

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
Hello,

I would like to know what function I should call to get the
total physical memory as well as the virtual memory currently used, for unix and windows.

Thanks for your help.

Fabien
 
Hey
You need to write a your native code to get the System Memory.
I can get u the virtual memory

Runtime.freeMemory();
Runtime.totalMemory();
Shyam Shyam
 
Make sure you create a reference to the Runtime object, as non static methods like freeMemory() and totalMemory() cannot be executed via the class java.lang.Runtime() .

Runtime myappRuntime = Runtime.getRuntime();
System.out.println("Total Free Memory is: " + myappRuntime.freeMemory());
System.out.println("Total Runtime Memory is: " + myappRuntime.totalMemory());
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top