Skip to content

CASSANDRA-19831: Clarify off-heap OOM error msg#4916

Open
liuisaac wants to merge 4 commits into
apache:trunkfrom
liuisaac:liuisaac/CASSANDRA-19831/trunk
Open

CASSANDRA-19831: Clarify off-heap OOM error msg#4916
liuisaac wants to merge 4 commits into
apache:trunkfrom
liuisaac:liuisaac/CASSANDRA-19831/trunk

Conversation

@liuisaac

@liuisaac liuisaac commented Jul 4, 2026

Copy link
Copy Markdown

Issue: CASSANDRA-19831

Purpose

Clarifies the warning message printed by JVMStabilityInspector.java when an off-heap OutOfMemoryError triggers a forced heap space crash.

Context

JVMStabilityInspector.forceHeapSpaceOomMaybe acts 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:

logger.error("Force heap space OutOfMemoryError in the presence of", oom);

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:

logger.error("Non-heap OutOfMemoryError detected, forcing a heap OutOfMemoryError to trigger standard JVM OOM handling:", oom);

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.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in forceHeapSpaceOomMaybe to explicitly indicate the initiating OOM is off-heap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/java/org/apache/cassandra/utils/JVMStabilityInspector.java Outdated
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/java/org/apache/cassandra/utils/JVMStabilityInspector.java Outdated
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/java/org/apache/cassandra/utils/JVMStabilityInspector.java
@bschoening bschoening self-requested a review July 7, 2026 20:32
@bschoening

Copy link
Copy Markdown
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants