• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Garbage Collection Questions

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello tomorrow is the Big day ...
I give the exam
one last point to review is that am not still sure that i can get right the garbage collection questions
.. So please can someone show me the way i can write diagrams for such questions ?
i would like to print it and just read it in the morning when i have coffee .(Like a newsPaper )
)))
now i will try to have some fun so tomorrow i will go more calm for the Exam.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



Every time your code calls "new ..." write the reference variable name outside the heap, draw the object created (a square for instance) inside the heap, and link up both elements with an arrow. When a reference variable changes, write a new arrow from this reference variable to the new target, and CROSS OFF the original reference variable arrow. At the time to call System.gc(), those objects crossed off are unreachable (unaccessible from a live thread) and so eligible for garbage collection. Be care with more complex objects which might contain inner references to either other references or new objects. The key point is draw arrows from references to their respective objects and removes (crossing off) when references changes.

I hope this helps.
 
peter kosmas
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot... It will indeed help ...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic