• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Working of Garbage collector

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi All,

Am I right on these two points:-

1>Any object whose reference variable is accessible by any live thread (daemon or user) be it a weak, strong, soft reference type is not eligible to be gced.

2>After the first condition is applied the GC has a knowledge of the objects that it can take out of memory and from this lot of objects first gc will try to get rid of weak then soft then strong.

Please correct me if Iam wrong.

Thanks,
Abhisek
 
Marshal
Posts: 75879
361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you may be mistaken about weak references. Have a look in the API for WeakReference and SoftReference. As far as I remember, there is a full explanation in those links. There is also something called PhantomReference. You would do well to look at that too. Also the links in those links.
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As an aside, you can also read this: it discusses Garbage collection process in general.
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic