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

G1: Ergonomically set MarkStackSize and use virtual space for global marking stack

XMLWordPrintable

    • gc
    • b13
    • generic
    • generic

        Currently the size of the global concurrent marking stack is fixed - it is set to 128 * TASKQUEUE_SIZE. Where TASKQUEUE_SIZE is 128K (131072) entries in a 64 bit JVM, or 16K (16384) entries in a 32 bit JVM.

        Basically the global marking stack is the equivalent of the task queues of an additional 128 marking threads.

        Also the global marking stack is allocated from C heap. In a 64 bit JVM the space allocated for the marking stack is 128Mb (128 * 131072 * 8) == 128 * 1Mb. In a 32 bit JVM the space allocated for the marking stack is 128 * 16384 * 4 == 128 * 64K = 8Mb.

        Also, unlike the marking stack in CMS, the marking stack in G1 is allocated in C heap. In CMS it is allocated in virtual space.

        We should set the marking stack size ergonomically - based upon the number of marking threads perhaps sized as if there were an additional task queue for each marking thread (up to the current fixed value - 128). We probably want to set a floor level (perhaps the default 4M entries) so that marking does not overflow too frequently. 4M entries is the equivalent of the task queues of 32 marking threads.

        We can also make mimic CMS and employ an expansion mechanism and expand the marking stack (up to the maximum) if an overflow occurs.

        Finally we should also mimic CMS and allocate the marking stack from virtual space.

              johnc John Cuthbertson
              johnc John Cuthbertson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: