RFR: JDK-8155004: CrashOnOutOfMemoryError doesn't work for OOM caused by inability to create threads
Thomas Stuefe
stuefe at openjdk.java.net
Tue Apr 20 11:52:35 UTC 2021
Greetings,
this is an old issue and I'd like to fix it. If we fail to create a java thread due to platform limitations we throw an OOM. But we fail to honor the various xxxOnOutOfMemoryError switches.
The fix is very straightforward.
One remaining question, maybe for a future RFE, is how we want to handle native threads creation error. AFAICS currently, failing to create a native thread may or may not result in a fatal shutdown, a log output, or just be ignored, depending on the thread.
If `...OnOutOfMemoryError` is specified, should native thread creation failure be handled the same way as a java thread?
- No if I take the option name literally, since there is no OOM involved
- Yes if I take into account what these switches are actually used for - analysis or quick shutdown of a JVM inside a container in case of an OOM. Since it is completely random which thread is hit by the limit.
Thanks, Thomas
-------------
Commit messages:
- start
Changes: https://git.openjdk.java.net/jdk/pull/3586/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3586&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8155004
Stats: 5 lines in 1 file changed: 5 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/3586.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3586/head:pull/3586
PR: https://git.openjdk.java.net/jdk/pull/3586
More information about the hotspot-dev
mailing list