Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8006742

Initial TLAB sizing heuristics might provoke premature GCs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • tbd
    • hs25, 10
    • hotspot
    • gc

      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

            Unassigned Unassigned
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: