Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Willie Howell   on Mar 22 In Java Category.

  
Question Answered By: Muhammad Evans   on Mar 22

I don't know which version of java  documentation you have but mine says:

<quote_jdk_1.3>
freeMemory

public long freeMemory()

Returns the amount of free  memory in the system. Calling the gc method  may
result in increasing the value returned by freeMemory.

Returns:
an approximation to the total amount of memory currently available for
future allocated objects, measured in bytes.
</quote_jdk_1.3>

But you can use the Runtime class  and use exec to call for example a dos
command and then grab the output
and parse it. Nasty, but AFAIK there is no other way.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on DISK SPACE CALCULATION Or get search suggestion and latest updates.


Tagged: