intern()'ed Strings, perm. gen and jmap
By sundararajan on Jun 28, 2006
I came across "All about intern()" recently. Few more facts:
- In Sun's JDK, internalized Strings are stored in the permanent generation and hence "compete" for space with meta-data (like, classes, methods, constant pools etc.)
- You may have to have increase perm. gen space using the -XX:MaxPermSize option.
- With Mustang (Java SE 6), the jmap tool's -permstat option prints statistics on the internalized trings (total number and size of occupied by intern'ed strings).