Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GC

 
Srinivas Katta
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have executed the below program for K&B Book Chapter 3 and attached the Diagram of my understanding


Could you Please explain how many objects will be eligible for garbage collection when line marked as //dostuff is reached?

Thanks
Srinivas
Garb.JPG
[Thumbnail for Garb.JPG]
 
Harshit Sethi
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only one object is eligible and that is object that was referred by a1 before it was set to null.
 
Harshit Sethi
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the proper diagram,i used paint so its not that tidy,but still you can get what you want from this diagram.

link to image
 
Harshit Sethi
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Someone tell me how to upload image here?
 
Mahmoud Hossam
Ranch Hand
Posts: 74
Linux Netbeans IDE Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harshit Sethi wrote:Someone tell me how to upload image here?


click on "attachments" button below the text pane,then select the file(s) you want to upload

The files cannot be larger than 1024KB,and you can't upload more than 3 files per post
 
Harshit Sethi
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here it is finally....
Untitled.jpg
Garbage Collection diagram
[Thumbnail for Untitled.jpg]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic