dcsimg
Is there a way to disable garbage collection compl...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   R_Deepak
Posted On:   Tuesday, February 13, 2001 10:08 PM

Is there a way to disable garbage collection completely? Garbage Collection should be invoked only if I use System.gc();

Re: Is there a way to disable garbage collection compl...

Posted By:   Stephen_Silber  
Posted On:   Friday, May 25, 2001 12:42 PM

Not in the Standard Edition (or bigger) JDK's. The Java Virtual Machine specification makes it pretty clear that you are at the mercy of the garbage collector. In fact, calling System.gc() only recommends to the JVM that it do a GC; it is not forced to do a GC at that time.

See the following:


  • http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html#gc()
  • http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#25388
  • http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#24383


(Yes, I agree, this is kind of a nasty in the JVM.)
About | Sitemap | Contact