This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GC

 
sanjana narayanan
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Static objects are not garbage collected at all. They are considered to be live objects. Is this true.
-Sanjana
 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, the answer is "False". A static reference is like any other reference - if it goes out of scope (i.e. no live thread can access it), the object referenced by it on the heap becomes available to GC. However, the system classes are never GC-ed. You may find the following link interesting:
No Silver Bullet - Garbage Collection for Java in Embedded Systems
Read the section named "Garbage Collection and Java".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic