JDK-8006742 : Initial TLAB sizing heuristics might provoke premature GCs
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25,10
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2013-01-23
  • Updated: 2018-10-15
  • Resolved: 2018-10-15
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.
Other
tbd_majorResolved
Related Reports
Duplicate :  
Description
Running this class:
public class Threads {
  public static void main(String [] args) throws Exception {
    int c = Integer.parseInt(args[0]);
    for (int i = 0; i < c; i++) {
      MyThread t = new MyThread();
      t.start();
    }

    Thread.sleep(5000);
  }

  static class MyThread extends Thread {
    public static Object dummy;
    public void run() {
      try {
        dummy = new byte[0];
        Thread.sleep(10000000);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
} 

with:
java -Xmn3520m -Xms3584m -Xmx3584m -XX:+PrintGC -XX:+PrintGCTimeStamps Threads 64

starts a young GC immediately:
0.075: [GC (Allocation Failure) 2703360K->488K(3219456K), 0.0012880 secs]

-XX:+PrintTLAB gives:
TLAB: gc thread: 0x00007f7204153800 [id: 17869] desired_size: 54067KB slow allocs: 0  refill waste: 865072B alloc: 1.00000  2703360KB refills: 1 waste 100.0% gc: 55364248B slow: 0B fast: 0B

Comments
The test is also fixed by JDK-8200365. Closing as duplicate; if you think there is a different issue, please reopen (or just give a reason why).
15-10-2018

Review thread at http://mail.openjdk.java.net/pipermail/hotspot-dev/2018-June/033050.html
19-06-2018

Still an issue in JDK 10, but only for non-G1 collectors. Looks like the tlab size is scaled by the young-gen size.
15-11-2017

Not sure who to assign this to so, for the moment, I make myself RE.
26-02-2013