Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / July 2006

Tip: Looking for answers? Try searching our database.

calculating Runtime.freeMemory() if mutiple java are running

Thread view: 
Captain Jack Sparrow - 19 Jul 2006 12:19 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 ?
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.