CASSANDRA-19831: Clarify off-heap OOM error msg#4916
Open
liuisaac wants to merge 4 commits into
Open
Conversation
Update the log string in JVMStabilityInspector to prevent operators from mistakenly increasing heap size when an off-heap OOM occurs. Patch by Isaac Liu; reviewed by TBD for CASSANDRA-19831
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the operator-facing log message emitted by JVMStabilityInspector.forceHeapSpaceOomMaybe(...) when Cassandra detects an off-heap OutOfMemoryError and intentionally forces a heap-space OOM to trigger standard JVM OOM handling (heap dumps, OnOutOfMemoryError, etc.).
Changes:
- Rewords the
logger.error(...)message inforceHeapSpaceOomMaybeto explicitly indicate the initiating OOM is off-heap.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Updated wording for the log to be less redundant and even more straightforward for operators to understand Patch by Isaac Liu; reviewed by TBD for CASSANDRA-19831
Changed wording of "Off-heap" to "Non-heap" to be more generic and match the contract defined in the comments of the method Patch by Isaac Liu; reviewed by TBD for CASSANDRA-19831
bschoening
approved these changes
Jul 7, 2026
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: CASSANDRA-19831
Purpose
Clarifies the warning message printed by
JVMStabilityInspector.javawhen an off-heap OutOfMemoryError triggers a forced heap space crash.Context
JVMStabilityInspector.forceHeapSpaceOomMaybeacts as a killswitch in the case of an off-heap OOM (ie:java.lang.OutOfMemoryError: Direct buffer memory), forcing a standard Java heap OOM (CASSANDRA-15214 and CASSANDRA-17128).Problem
Previous log string read:
The log begins with "Force heap space OutOfMemoryError," which seems to suggest a heap issue rather than non-heap where this log is triggered. This choice of phrasing can confuse operators, who may respond by mistakenly increasing allocation to Java heap.
Solution
Updated the logging output to lead with:
This wording makes it immediately clear that the OOM occurs non-heap. This should make non-heap OOMs less confusing as the error log is more direct in what has caused the error.