wankunde commented on PR #52678: URL: https://github.com/apache/spark/pull/52678#issuecomment-3431604925
@pan3793 > ZGC has three different sizes for regions; small, medium, and large. > Large Regions Large regions are reserved for humongous objects and are tightly fitted in 2 MB increments to the object's size. For ZGC, if we allocate a 4MB long array, approximately `2MB / (4MB + 2MB) ~ 33%` of memory is wasted; if we allocate a 16MB long array, approximately `2MB / (16MB + 2MB) ~ 11%` of memory are wasted. Test ZGC with `-Xmx1000m` without this optimization: ```log [0.580s][info][gc] GC(11) Major Collection (Allocation Stall) 988M(99%)->996M(100%) 0.030s Total allocated size: 889192448 [0.581s][info][gc] GC(12) Minor Collection (Allocation Stall) [0.587s][info][gc] Relocation Stall (Attach Listener) 0.053ms [0.587s][info][gc] GC(12) Minor Collection (Allocation Stall) 996M(100%)->1000M(100%) 0.005s [0.587s][info][gc] GC(13) Major Collection (Allocation Stall) [0.593s][info][gc] GC(14) Minor Collection (Allocation Stall) [0.597s][info][gc] GC(14) Minor Collection (Allocation Stall) 996M(100%)->996M(100%) 0.004s [0.606s][info][gc] GC(13) Major Collection (Allocation Stall) 1000M(100%)->992M(99%) 0.019s [0.606s][info][gc] Allocation Stall (main) 24.366ms [0.606s][info][gc] Out Of Memory (main) Terminating due to java.lang.OutOfMemoryError: Java heap space ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
