JDK-8015422 : Large performance hit when the StringTable is walked twice in Parallel Scavenge
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-05-27
  • Updated: 2013-06-11
  • Resolved: 2013-05-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8Fixed hs25Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Description
While investigating JDK-8015268, I found that a large portion of the young GC times where spent in the single-thread phase that prunes the StringTable (where interned Strings are registered).

This phase walks the StringTable twice. First to unlink all dead Strings and then to to update the references to all live Strings.

By simply combining these walks I could get a 10% decrease in young GC times on CRM Sales Opty.


Comments
Out for review: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2013-May/007352.html
28-05-2013

The GC time improvement can also be seen with this simple micro benchmark: java -Xmx1g -Xms1g -Xmn128m -XX:-UseAdaptiveSizePolicy -XX:+PrintGC InternedStringBenchmark public class InternedStringBenchmark { public static int numStrings = 1000000; public static String[] strings = new String[numStrings]; public static Object dummy; public static void main(String [] args) { for (int i = 0; i < numStrings; i++) { strings[i] = String.valueOf(i).intern(); } System.out.println("Interned done"); // provoke young GCs while (true) { dummy = new byte[2 * 1024]; } } }
28-05-2013

We might want to parallelize the unlinking/scanning of the StringTable in Parallel Scavenge. See: JDK-8015237.
27-05-2013

Found while investigating JDK-8015268.
27-05-2013