Home > Java > Beware of interned strings with G1

Beware of interned strings with G1

Interned strings can always be problematic, as the size of the hash table is fixed. Perhaps the -XX:+UseStringDeduplication option can make things worse, as (according to native memory tracing) it seems to use the same pool. However, at present there is a more pressing problem with Java 8 and 9 using the G1 garbage collector: interned strings may not be garbage collected at all, resulting in a native memory leak. See JDK-8180048. What to do? Stay calm or switch to another garbage collector. But be sure to keep an eye on the native memory usage of your Java applications!

Advertisements
Categories: Java
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: