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

Parallel GC lays out the array references in the reverse order

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8
    • hotspot
    • Linux, x86_64

    • gc

      See the original discussion at:
        http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2013-September/008196.html

      In short, when laying out the Object[], ParallelGC pushes the array elements on stack during the traversal, and pops them back as it actually process them. This results in the reverse memory layout for referenced elements.

      This issue should be fixed because:
       a) Depending on HW, you may or may not have the same performance walking back the memory; in particular, think about the non-x86 embedded scenarios where you don't have the luxury of advanced memory prefetchers;
       b) Even if you *do* have the good memory prefetcher ready at your disposal, accessing the first element will entail two memory accesses,
      because the first element is rather far off the base; keeping the first element closer to base may have the effect of having the first element
      right there on the same cache line;
       c) The Parallel GC layout is inconsistent with the layouts other GCs produce; which can have the surprising performance differences vs other collectors; I don't like surprising behaviors, and think we should minimize them where possible.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: