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

GC stacks should use a better data structure

    XMLWordPrintable

Details

    • gc
    • generic, unknown, x86
    • generic, linux_2.4, windows

    Backports

      Description

        The marking stack used by MarkSweep currently uses a GrowableArray<oop>. That's overkill, since we only use the marking stack as a stack. In contrast, GrowableArray implements an array, so when it expands, it reallocs and copies the whole array to a new, larger, piece of contiguous memory. Since the marking stack is often large, this often requires a large contiguous chunk of memory, which can be difficult to acquire. Since GrowableArray grows by doubling, on average 25% of the array will be empty. When the marking stack is large, this can be a substantial waste of space.

        Instead, the stack could be implemented as a chained series of small regions. This could allow us to balance the storage for the chain pointers against the increment of growth, to use an appropriate amount of space in modest chunks.

        Attachments

          Issue Links

            Activity

              People

                jcoomes John Coomes (Inactive)
                pbk Peter Kessler
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: