my dog learned polymorphism
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Garbage collection 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 "Garbage collection" Watch "Garbage collection" New topic

Garbage collection

Ranch Hand

Joined: Jul 27, 2000
Posts: 45
Can a programmer code to run the GC whenever you want to?
Ranch Hand

Joined: Aug 29, 2000
Posts: 41
GC can be called in the finalise method if you so want to do the garbage collection.
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi ...
You can call System.gc() or Runtime.gc() any time you want but it does not guarantee garbage collection will occur.

Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
I agree. Here's the link:
subject: Garbage collection
It's not a secret anymore!