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 Not EGC..... why? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Not EGC..... why?" Watch "Not EGC..... why?" New topic
Author

Not EGC..... why?

Vicken Karaoghlanian
Ranch Hand

Joined: Jul 21, 2003
Posts: 522
why gd is NOT eligible for GC?


- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
There are at least two reasons the make the thread not eligible for gc :
a) it is running
b) the thread object is referred from the ThreadGroup main
This code shows that even if a thread has finished a reference to it is still in the related thread group.

And this one shows that even nullifying the thread group, gd is not eligible for garbage collection. Presumably because is still referenced from somewhere else.

[ October 10, 2003: Message edited by: Jose Botella ]

SCJP2. Please Indent your code using UBB Code
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not EGC..... why?
 
Similar Threads
garbage collection
garbage collection eligibility
Constructor for a subclass.
Conversion of 'Array object'!
Some confusing ones part2