apache/cassandra · warning
The JVM is not configured to stop on OutOfMemoryError which
Error message
The JVM is not configured to stop on OutOfMemoryError which can cause data corruption. Either upgrade your JRE to a version greater or equal to 8u92 and use -XX:+ExitOnOutOfMemoryError/-XX:+CrashOnOutOfMemoryError or use -XX:OnOutOfMemoryError="<cmd args>;<cmd args>" on your current JRE.
What it means
Same family as the modern OOM check, but emitted when the JVM is older than 8u92 (JavaUtils.supportExitOnOutOfMemory is false). In that case only -XX:OnOutOfMemoryError= is available; if it is absent, the check warns that the node will not stop on OutOfMemoryError and recommends either upgrading the JRE to >= 8u92 or using the OnOutOfMemoryError hook.
Source
Thrown at src/java/org/apache/cassandra/service/StartupChecks.java:627
}
}
/**
* Checks that the JVM is configured to handle OutOfMemoryError
*/
private void checkOutOfMemoryHandling()
{
if (JavaUtils.supportExitOnOutOfMemory(JAVA_VERSION.getString()))
{
if (!jvmOptionsContainsOneOf("-XX:OnOutOfMemoryError=", "-XX:+ExitOnOutOfMemoryError", "-XX:+CrashOnOutOfMemoryError"))
logger.warn("The JVM is not configured to stop on OutOfMemoryError which can cause data corruption."
+ " Use one of the following JVM options to configure the behavior on OutOfMemoryError: "
+ " -XX:+ExitOnOutOfMemoryError, -XX:+CrashOnOutOfMemoryError, or -XX:OnOutOfMemoryError=\"<cmd args>;<cmd args>\"");
}
else
{
if (!jvmOptionsContainsOneOf("-XX:OnOutOfMemoryError="))
logger.warn("The JVM is not configured to stop on OutOfMemoryError which can cause data corruption."
+ " Either upgrade your JRE to a version greater or equal to 8u92 and use -XX:+ExitOnOutOfMemoryError/-XX:+CrashOnOutOfMemoryError"
+ " or use -XX:OnOutOfMemoryError=\"<cmd args>;<cmd args>\" on your current JRE.");
}
}
/**
* Checks if one of the specified options is being used.
* @param optionNames The name of the options to check
* @return {@code true} if one of the specified options is being used, {@code false} otherwise.
*/
private boolean jvmOptionsContainsOneOf(String... optionNames)
{
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
List<String> inputArguments = runtimeMxBean.getInputArguments();
for (String argument : inputArguments)
{
for (String optionName : optionNames)
if (argument.startsWith(optionName))View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Upgrade the JRE to 8u92 or later and add -XX:+ExitOnOutOfMemoryError.
- If unable to upgrade, add -XX:OnOutOfMemoryError="kill -9 %p" (or a script) to JVM_OPTS.
- Better: move to a supported JDK 11/17 for your Cassandra version.
- Confirm via jcmd VM.flags that the handler is registered.
Example fix
// before JVM_OPTS="$JVM_OPTS -Xmx8G" # Java 8u71, no OOM hook // after JVM_OPTS="$JVM_OPTS -XX:OnOutOfMemoryError=\"kill -9 %p\"" # or upgrade to 8u92+ and use -XX:+ExitOnOutOfMemoryError
Defensive patterns
Strategy: validation
Validate before calling
String v = System.getProperty("java.version");
boolean modern = !v.startsWith("1.8") || Arrays.compareUnsigned(
javaVersionParts(v), new int[]{1,8,0,92}) >= 0;
if (!modern) System.out.println("Old JRE: use -XX:OnOutOfMemoryError or upgrade to 8u92+"); Prevention
- Keep JREs at 8u92+ (ideally JDK 11/17 per Cassandra version matrix).
- Schedule JVM patch upgrades; treat pre-u92 builds as unsupported.
- Add OnOutOfMemoryError hook to legacy nodes as an interim safeguard.
- Audit JVM_OPTS with a config-management linter.
When it happens
Trigger: Running Cassandra on a JRE older than 8u92 whose JVM_OPTS contain no -XX:OnOutOfMemoryError= option.
Common situations: Legacy data centers pinned to old Oracle 8 builds, RHEL-packaged java-1.8.0-openjdk before u92, frozen base images from pre-2016.
Understand the failure class
Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.
Related errors
- The JVM is not configured to stop on OutOfMemoryError which
- 32bit JVM detected. It is recommended to run Cassandra on a
- Non-Oracle JVM detected. Some features, such as immediate u
- Access is denied!
- Threshold value for gc_log*_threshold must be greater than 0
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/0120f8c1906d0402.
Report an issue: GitHub.