Reputation: 1385
I am aware of string pool in java but how long does the string pool exists- till the jvm stops or when the class is unloaded .
i mean is it class specific or jvm specific . i saw another link for reference but that didnt clear up my doubt .
Upvotes: 2
Views: 449
Reputation: 550
Since Java 7, String Pool is a pool of Strings stored in Java Heap Memory. So it means that String values on the pool are garbage collected when they become unreachable. If don't, they are available till the end of JVM life.
Upvotes: 2