VM behavior is not correct with -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=.... Allocated memory is not released.
Use attached AllocObject.java to reproduce this issue:
java -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=10m -XX:+UseG1GC -Xmx25m AllocObjects
VM crashes with message:
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 4092 bytes for AllocateHeap
# An error report file with more information is saved as:
# /home/cmv/tmp/hs_err_pid16722.log
-XX:MallocMaxTestWords can be 100m or 256m - it affects test execution time.
hs_err for G1GC and ParallelGC are attached.
Use attached AllocObject.java to reproduce this issue:
java -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=10m -XX:+UseG1GC -Xmx25m AllocObjects
VM crashes with message:
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 4092 bytes for AllocateHeap
# An error report file with more information is saved as:
# /home/cmv/tmp/hs_err_pid16722.log
-XX:MallocMaxTestWords can be 100m or 256m - it affects test execution time.
hs_err for G1GC and ParallelGC are attached.
- relates to
-
JDK-8058897 Unsafe.reallocateMemory() ignores -XX:MallocMaxTestWords setting
-
- Closed
-