-
Bug
-
Resolution: Won't Fix
-
P3
-
8, 9, 11, 15, 16, 17
-
x86_64
-
linux
Update 2021-04-20: this affects all ....OnOutOfMemoryError switches, not only CrashOnOutOfMemoryError.
--------------
FULL PRODUCT VERSION :
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
FULL OS VERSION :
Linux xxxxx 4.0.9 #1 SMP Fri Feb 26 15:21:14 PST 2016 x86_64 x86_64 x86_64 GNU/Linux
Darwin xxxxx 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/REL
A DESCRIPTION OF THE PROBLEM :
The newly introduced CrashOnOutOfMemoryError option doesn't appear to work when the cause of the OOM is due to not being able to create new threads.
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the program below with "java -XX:+CrashOnOutOfMemoryError Test". After a few seconds, an OutOfMemoryError (unable to create new native thread) will be printed to the console but the program won't exit.
EXPECTED VERSUS ACTUAL BEHAVIOR :
I would expect the VM to crash, but it keeps running.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Test {
public static void main(String[] args)
throws InterruptedException
{
Thread t = new Thread(() -> {
while (true) {
new Thread(() -> {
try {
Thread.currentThread().join();
}
catch (InterruptedException e) {
}
}).start();
}
});
t.start();
Thread.currentThread().join();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use a JVMTI agent to intercept ResourceExhausted events and forcibly exit the VM (e.g., https://github.com/airlift/jvmkill)
--------------
FULL PRODUCT VERSION :
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
FULL OS VERSION :
Linux xxxxx 4.0.9 #1 SMP Fri Feb 26 15:21:14 PST 2016 x86_64 x86_64 x86_64 GNU/Linux
Darwin xxxxx 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/REL
A DESCRIPTION OF THE PROBLEM :
The newly introduced CrashOnOutOfMemoryError option doesn't appear to work when the cause of the OOM is due to not being able to create new threads.
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the program below with "java -XX:+CrashOnOutOfMemoryError Test". After a few seconds, an OutOfMemoryError (unable to create new native thread) will be printed to the console but the program won't exit.
EXPECTED VERSUS ACTUAL BEHAVIOR :
I would expect the VM to crash, but it keeps running.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Test {
public static void main(String[] args)
throws InterruptedException
{
Thread t = new Thread(() -> {
while (true) {
new Thread(() -> {
try {
Thread.currentThread().join();
}
catch (InterruptedException e) {
}
}).start();
}
});
t.start();
Thread.currentThread().join();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use a JVMTI agent to intercept ResourceExhausted events and forcibly exit the VM (e.g., https://github.com/airlift/jvmkill)
- duplicates
-
JDK-8155585 ExitOnOutOfMemory doesn't work well for outof memory error
- Closed
- relates to
-
JDK-8154713 incorrect XxxOnOutOfMemoryError options in release notes
- Resolved
-
JDK-8155585 ExitOnOutOfMemory doesn't work well for outof memory error
- Closed
-
JDK-8257790 ExitOnOutOfMemoryError doesn't cover OOMEs from Java libraries
- Closed
- links to
-
Review openjdk/jdk/3586