• Post Reply Bookmark Topic Watch Topic
  • New Topic

garbage collection  RSS feed

 
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?
 
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
 
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?
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!