This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not EGC..... why?

 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why gd is NOT eligible for GC?
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic