Why is Arrays.fill 265 times slower on G1GC?
Summary
A deep dive into why Arrays.fill runs dramatically slower under G1GC than ParallelGC on ARM64. The author identifies the barrier-based overhead and a full memory fence in the slow path, especially when filling large arrays that end up in old generation, and traces the root cause through multiple layers of the JVM stack, from assembly to barrier implementation. The piece also notes a significant improvement in Java 26 (JEP 522) that reduces or removes this cost by changing the barrier mechanism.