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

Parallel: Refactor ParallelScavengeHeap::mem_allocate_work

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • hotspot
    • gc

      This method is the allocation entry API for mutators. Its flow is the following

      1. try young-gen
      2. try old-gen
      3. invoke GC operation
      4. if GC-op succeeds, return; otherwise, go to 1

      Before step 3, we need to call `total_collections()`, which requires holding `Heap_lock`. The current code invokes old-gen allocation while holding `Heap_lock`.

      However, the old-gen allocation API supports multi-thread, so it can be moved outside the critical-region. This cleans up the structure and streamlines the flow.

            ayang Albert Yang
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: