{"record":{"id":"0120f8c1906d0402","repo":"apache/cassandra","slug":"the-jvm-is-not-configured-to-stop-on-outofmemoryer-0120f8","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/StartupChecks.java","lineNumber":627,"sourceCode":"            }\n        }\n\n        /**\n         * Checks that the JVM is configured to handle OutOfMemoryError\n         */\n        private void checkOutOfMemoryHandling()\n        {\n            if (JavaUtils.supportExitOnOutOfMemory(JAVA_VERSION.getString()))\n            {\n                if (!jvmOptionsContainsOneOf(\"-XX:OnOutOfMemoryError=\", \"-XX:+ExitOnOutOfMemoryError\", \"-XX:+CrashOnOutOfMemoryError\"))\n                    logger.warn(\"The JVM is not configured to stop on OutOfMemoryError which can cause data corruption.\"\n                                + \" Use one of the following JVM options to configure the behavior on OutOfMemoryError: \"\n                                + \" -XX:+ExitOnOutOfMemoryError, -XX:+CrashOnOutOfMemoryError, or -XX:OnOutOfMemoryError=\\\"<cmd args>;<cmd args>\\\"\");\n            }\n            else\n            {\n                if (!jvmOptionsContainsOneOf(\"-XX:OnOutOfMemoryError=\"))\n                    logger.warn(\"The JVM is not configured to stop on OutOfMemoryError which can cause data corruption.\"\n                            + \" Either upgrade your JRE to a version greater or equal to 8u92 and use -XX:+ExitOnOutOfMemoryError/-XX:+CrashOnOutOfMemoryError\"\n                            + \" or use -XX:OnOutOfMemoryError=\\\"<cmd args>;<cmd args>\\\" on your current JRE.\");\n            }\n        }\n\n        /**\n         * Checks if one of the specified options is being used.\n         * @param optionNames The name of the options to check\n         * @return {@code true} if one of the specified options is being used, {@code false} otherwise.\n         */\n        private boolean jvmOptionsContainsOneOf(String... optionNames)\n        {\n            RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();\n            List<String> inputArguments = runtimeMxBean.getInputArguments();\n            for (String argument : inputArguments)\n            {\n                for (String optionName : optionNames)\n                    if (argument.startsWith(optionName))","sourceCodeStart":609,"sourceCodeEnd":645,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StartupChecks.java#L609-L645","documentation":"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.","triggerScenarios":"Running Cassandra on a JRE older than 8u92 whose JVM_OPTS contain no -XX:OnOutOfMemoryError= option.","commonSituations":"Legacy data centers pinned to old Oracle 8 builds, RHEL-packaged java-1.8.0-openjdk before u92, frozen base images from pre-2016.","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."],"exampleFix":"// before\nJVM_OPTS=\"$JVM_OPTS -Xmx8G\"  # Java 8u71, no OOM hook\n// after\nJVM_OPTS=\"$JVM_OPTS -XX:OnOutOfMemoryError=\\\"kill -9 %p\\\"\"  # or upgrade to 8u92+ and use -XX:+ExitOnOutOfMemoryError","handlingStrategy":"validation","validationCode":"String v = System.getProperty(\"java.version\");\nboolean modern = !v.startsWith(\"1.8\") || Arrays.compareUnsigned(\n    javaVersionParts(v), new int[]{1,8,0,92}) >= 0;\nif (!modern) System.out.println(\"Old JRE: use -XX:OnOutOfMemoryError or upgrade to 8u92+\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["jvm","outofmemory","startup-check","legacy"],"backgroundTag":"missing-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}