• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

gc: object reference

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most books mention that ONLY objects with no references will be garbage collected.
However, Mughal & Rasmussen states that an object is only eligible for garbage collection if the only references to the object are from other objects that are also eligible for garbage collection. In other words, they still have references.
Does anybody know how to answer if such question appears in exam?

[This message has been edited by Kevin Yip (edited May 05, 2001).]
 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kevin,
I understand your difficulty. The best way to answer the
questions on Garbage collection is use a paper and pen.
Assign the reference to the object created, do so meticulously
after each execution and as soon as you see that a particular
object is not reacheable by any refernce, then the JVM will
find the object that has been derefenced eligible for garbage collection.
There are many discussion happening in this forum you may search and refer to them for more insights.
Ravindra Mohan
------------------
 
reply
    Bookmark Topic Watch Topic
  • New Topic