• 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

garbage collectiion

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone explain me about "isolating a refernce"
 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably you mean the little part of chapter 3 of Kathy Sierra's book named "Isolating a Reference". You need to have good understanding of the terms "reference" and "garbage collector".



As far as I understand it, you can't do such thing as "isolating the reference". You can only isolate a group of objects.

Let's say that you have two objects, a and b. Object a has the reference to object b. Object b has reference to object a. There is no other references to object a and there is no other references to object b.

In such situation we call object a and b together as island of isolation. It is named like that because there is no way to get there, as there is no reference from the outside.

Usually garbage collector detects such islands and removes them.


Do you understand?

If no, please try to point the parts of the explanation above which you don't understand and describe what should be clarified.
 
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Let's say that you have two objects, a and b. Object a has the reference to object b. Object b has reference to object a. There is no other references to object a and there is no other references to object b.



I didn't get this. You are telling a has reference of ba nd b has rference of a tht means a=b and b=a . Correct me if i am wrong.
What means to other refrence in your quote, can you explain in detail little
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

-----------------------
here i1 has-a ref to i2, and i2 has-a ref to i1. Assumption is that there is no other objects that have has-a relationship regarding this two objects, so in that situation they are "island of isolation", and thus eligible for gc.

regards,
Ivan Ivanic
[ April 22, 2008: Message edited by: ivan ivanic ]
 
sakthi karthik
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you Ismael Upright & ivan ivanic
i understand now clearly
if two or more objects has references with each other and when there is no other reference from outside then they are isolated references.

is that right?

thank you once again

regards
sakthi
 
Ismael Upright
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is right

And islands of isolation can be removed by garbage collector from the memory.
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic