Starting with JDK7, you can use the -XX:+PrintStringTableStatistics JVM flag to print string table size information, such as the number of buckets and bucket size.
You can also use the jmap tool by calling the jmap -heap *process_id* command, which at the end will display the number of interned lines and the total size (also requires JDK7 +).
Check out this blog post for more details.
source share