There's a race in the ZGC allocation path, which can lead to pre-mature OOME being thrown. The problem happens when two or more threads try to allocate a new "shared page" at the same time. These threads will race to allocate a new page, but when doing so each thread will potentially end up the the allocation queue with each thread requesting e.g. 32M even though a single 32M request could have been enough to satisfy the requests from all threads. There needs to be some kind of coordination or signal so that these threads understand that some other thread might have completed the allocation for them instead of throwing pre-mature OOME in these situations.
This problem can be fairly easily be reproduced by the following test: open/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java
This problem can be fairly easily be reproduced by the following test: open/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java
- duplicates
-
JDK-8339387 ZGC: Synchronize medium page allocation
-
- Resolved
-