aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String Pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "String Pool" Watch "String Pool" New topic
Author

String Pool

deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
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



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String Pool
 
Similar Threads
Garbage Collection Doubt
GC Doubt
doubt in String object
Doubt regarding GC
string doubt