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 GC 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 "GC" Watch "GC" New topic
Author

GC

sanjana narayanan
Ranch Hand

Joined: Nov 25, 2003
Posts: 142
Hi,
Static objects are not garbage collected at all. They are considered to be live objects. Is this true.
-Sanjana
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
Hi, the answer is "False". A static reference is like any other reference - if it goes out of scope (i.e. no live thread can access it), the object referenced by it on the heap becomes available to GC. However, the system classes are never GC-ed. You may find the following link interesting:
No Silver Bullet - Garbage Collection for Java in Embedded Systems
Read the section named "Garbage Collection and Java".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GC