https://github.com/openjdk/jdk/blob/f71f9dc93a6963ce36953e0ad770edd761afd0b4/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp#L87
WhenJDK-8202286 (Allocation of old generation of Java heap on alternate memory devices) is enabled, we call ReservedSpace::first_part with (split == true).
ReservedSpace::first_part() calls os::split_reserved_memory, which, on Windows, would release the space and try to reserve it again as two spaces. However, due to change in overall system memory pressure, the reservation attempts may fail.
https://github.com/openjdk/jdk/blob/1332ba3c3c168d9fa368338e451c8c20a4c47ccc/src/hotspot/share/memory/virtualspace.cpp#L258
ReservedSpace ReservedSpace::first_part(size_t partition_size, size_t alignment, bool split) {
assert(partition_size <= size(), "partition failed");
if (split && partition_size > 0 && partition_size < size()) {
os::split_reserved_memory(base(), size(), partition_size);
}
ReservedSpace result(base(), partition_size, alignment, special(),
executable());
return result;
}
https://github.com/openjdk/jdk/blob/1332ba3c3c168d9fa368338e451c8c20a4c47ccc/src/hotspot/os/windows/os_windows.cpp#L3120
void os::split_reserved_memory(char *base, size_t size, size_t split) {
...
release_memory(base, size);
attempt_reserve_memory_at(base, split);
attempt_reserve_memory_at(split_address, size - split);
When
ReservedSpace::first_part() calls os::split_reserved_memory, which, on Windows, would release the space and try to reserve it again as two spaces. However, due to change in overall system memory pressure, the reservation attempts may fail.
https://github.com/openjdk/jdk/blob/1332ba3c3c168d9fa368338e451c8c20a4c47ccc/src/hotspot/share/memory/virtualspace.cpp#L258
ReservedSpace ReservedSpace::first_part(size_t partition_size, size_t alignment, bool split) {
assert(partition_size <= size(), "partition failed");
if (split && partition_size > 0 && partition_size < size()) {
os::split_reserved_memory(base(), size(), partition_size);
}
ReservedSpace result(base(), partition_size, alignment, special(),
executable());
return result;
}
https://github.com/openjdk/jdk/blob/1332ba3c3c168d9fa368338e451c8c20a4c47ccc/src/hotspot/os/windows/os_windows.cpp#L3120
void os::split_reserved_memory(char *base, size_t size, size_t split) {
...
release_memory(base, size);
attempt_reserve_memory_at(base, split);
attempt_reserve_memory_at(split_address, size - split);
- duplicates
-
JDK-8256213 Remove os::split_reserved_memory
- Resolved
- relates to
-
JDK-8255917 runtime/cds/SharedBaseAddress.java failed "assert(reserved_rgn != 0LL) failed: No reserved region"
- Resolved
-
JDK-8253649 Potential bug in os::split_reserved_memory on windows
- Closed
-
JDK-8202286 Allocation of old generation of Java heap on alternate memory devices
- Resolved
-
JDK-8256181 Remove Allocation of old generation on alternate memory devices functionality
- Resolved