File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Garbage collection" Watch "Garbage collection" New topic
Author

Garbage collection

Whiz Kid
Greenhorn

Joined: Jul 02, 2002
Posts: 6
Hey,
I am not able to follow the Concept of garbaghe collection and How to enforce it in a program.
Can anyone help me with this and any resources or links regardiong this will be of great help.
thaanks So much
Gowri


gowri Venkatesh
Binu K Idicula
Ranch Hand

Joined: Jul 11, 2002
Posts: 99
You cannot enforce garbage collection. But you can request the system to do that by calling System.gc().
Garbage colector is a low priority thread running asynchronously to your program exacution threads.
It detects unreachable objects, mark them ,invoke it's finalize (if overridden ), and frees memory all in the background with no specific time bound.
You cannot specify the exact time of garbage collection.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Good article on garbage collection:
Reference Objects and Garbage Collection


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Garbage collection
 
Similar Threads
WA #1.....word association
Regular Expression
can any one explain me garbage collection with the help of a simple program ?
Difference between 'collection' and 'Collection'
Vector and Collection