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

Serial: Refactor SerialHeap::mem_allocate_work

XMLWordPrintable

    • gc
    • master

      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 while holding `Heap_lock`.

      An alternative is to use par_allocate API 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:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: