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

Static variable

 
Fisher Daniel
Ranch Hand
Posts: 582
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
When are static variables eligible to garbage collection?
thanks
daniel
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Static variables are garbage collected when the class they belong to is garbage collected. Classes can only be collected when nothing refers to that class anymore.
kind regards
 
John Wetherbie
Rancher
Posts: 1449
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the static variable is being used by a number of objects then it is eligible for GC when the last object using it is GC'd.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic