This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

String Pool  RSS feed

 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have got a doubt. & that is
when are the objects in the string pool garbage collected?
for example
.
.
String a = "literal_1"; //1
String b = "literal_2"; //2
a = null; //3
b = null; //4
.
.
..
whether the literals in line 1 & 2 are eligible for gc after line 4 has executed.
i feel they are not eligible for gc since they are in string pool. but that raises my doubt that when they will be gced.because if i keep on creating literals then my program will run out of memory if gc won't claim the string pool?
thanx in advance
deekasha



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!