Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

garbage collection

 
Arun Prasath
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will the string objects in the string constant pool be garbage collected?
 
Pradeep Kadambar
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No string literals are not garbage collected. Here is a very good explanation of the same.

web Garbage collection for String literals
 
Dana Bothner-By
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought that String literals could be garbage collected under ceratin conditions, like if the ClassLoader that causes them to be loaded into memory was itself garbage collected. Am I wrong?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic