my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes You can directly run the GC whenever you want to ????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "You can directly run the GC whenever you want to ?????" Watch "You can directly run the GC whenever you want to ?????" New topic
Author

You can directly run the GC whenever you want to ?????

sarim raza
Ranch Hand

Joined: Nov 02, 2000
Posts: 232
true or false ?
Kiran Sharma
Greenhorn

Joined: Dec 09, 2000
Posts: 5
Hi, I guess its false, At the most u can make an object
'eligible' for g/c.But whether/when the object will be
g/c'd is the prerogative of the jvm and not the programmer.
Plz. correct me if i am wrong.
sarim raza
Ranch Hand

Joined: Nov 02, 2000
Posts: 232
thanks kiran, one of the mocks said it was true though so i just wanted to be sure ...
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
You should note that you can call it directly by writing System.gc(). But this doesn't gurantee that the objects no longer in use will be collected. So the answer is true according to Khalidp.255 "The System.gc() method can be used to force garbage collection.."
Mandeep Singh
Greenhorn

Joined: Dec 21, 2000
Posts: 14
Hi, u can't run garbage collector whenever u want to. U can just put a request that u want the garbage collector to be run, it is then upto the JVM to run the garbage collector depending on the priorities of the jobs it has to do, so that running gc does not affect the performance of ur program. So u can not be sure whether unreferenced objects will be garbage collected or not.
Originally posted by sarim raza:
true or false ?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: You can directly run the GC whenever you want to ?????
 
Similar Threads
youngest SCWCD???
Oh boy !!!!!
is there any NetBeans specefic forum?
ersin
problem when running container tests in weblogic server