Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

garbage collection?

 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here the objects eligible for gc are story and c1...why is cb not eleigible for gc..since after local method completes all objects become eligible for gc and cb is pointing to null???
 
W. Joe Smith
Ranch Hand
Posts: 710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because cb is just a reference to the same object c2 is pointing to. Since c2 still points to that object, the object is not available for gc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic