I have a question : if I run two instances of Java and then calculate
the Runtime.freeMemory() then what exactly is it supposed to give me ?
1) is the free memory of the respective class that is running
2) free memory of both the classes in common ?
more to Explain :
shell commands that i execute are
java class_1 &
java class_2
thus i am orunning two instances of java. If both the classes call the
funtion Runtime.freeMemory()
and Runtime.totalMemory().
please tell me what exactly does the values denote now ...?
are these values for the common processes ie totalMemory =
totalMemory() <case 1> + totalMemory() <case 2> and please tell me what
happens in the case of freeMemory() ?
Please clarfiy this.
Thanks .
Alexander - 20 Jul 2006 11:44 GMT
> I have a question : if I run two instances of Java and then calculate
> the Runtime.freeMemory() then what exactly is it supposed to give me ?
[quoted text clipped - 15 lines]
> Please clarfiy this.
> Thanks .
freeMemory() basically tells you how much memory is available in the
virtual machine running your class. If you run two java instances as in
your example you have two separate virtual machines running, hence you
get for each freeMemory() call the amount of free memory for the
particular virtual machine.
Alexander