{"record":{"id":"dbfe0ebc54d4d00f","repo":"apache/cassandra","slug":"garbage-collection-summary","errorCode":null,"errorMessage":"<garbage collection summary>","messagePattern":"<garbage collection summary>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/GCInspector.java","lineNumber":331,"sourceCode":"                    sb.append(\" -> \");\n                    sb.append(after.getUsed());\n                    if (!key.equals(gcState.keys[gcState.keys.length - 1]))\n                        sb.append(\"; \");\n                    bytes += before.getUsed() - after.getUsed();\n                }\n            }\n\n            while (true)\n            {\n                State prev = state.get();\n                if (state.compareAndSet(prev, new State(duration, bytes, prev)))\n                    break;\n            }\n\n            if (isConcurrentPhase(info.getGcCause(), info.getGcName()))\n            {\n                if (getGcConcurrentPhaseWarnThresholdInMs() != 0 && duration > getGcConcurrentPhaseWarnThresholdInMs())\n                    logger.warn(sb.toString());\n                else if (duration > getGcConcurrentPhaseLogThresholdInMs())\n                    logger.info(sb.toString());\n                else if (logger.isTraceEnabled())\n                    logger.trace(sb.toString());\n\n                if (duration > this.getConcurrentStatusThresholdInMs())\n                    StatusLogger.log();\n            }\n            else\n            {\n                if (getGcWarnThresholdInMs() != 0 && duration > getGcWarnThresholdInMs())\n                    logger.warn(sb.toString());\n                else if (duration > getGcLogThresholdInMs())\n                    logger.info(sb.toString());\n                else if (logger.isTraceEnabled())\n                    logger.trace(sb.toString());\n\n                if (duration > this.getStatusThresholdInMs())","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/GCInspector.java#L313-L349","documentation":"A WARN/INFO/TRACE log (not an exception) from GCInspector.handleNotification for a GarbageCollectionNotificationInfo whose GC is a concurrent phase (e.g. G1 concurrent mark/cleanup). The '<garbage collection summary>' string is the formatted GC statistics built into sb. It is logged at WARN when the duration exceeds the concurrent-phase warn threshold (gc_concurrent_phase_warn_threshold_in_ms), INFO above the log threshold, TRACE otherwise, and additionally dumps a StatusLogger status when the duration exceeds the concurrent status threshold (default 200ms).","triggerScenarios":"JVM GC bean notification for a concurrent collection phase whose duration exceeds getGcConcurrentPhaseWarnThresholdInMs() (WARN), getGcConcurrentPhaseLogThresholdInMs() (INFO), or any duration with trace logging enabled; StatusLogger fires when duration > getConcurrentStatusThresholdInMs().","commonSituations":"Large heaps with G1/ZGC/CMS concurrent cycles taking hundreds of ms; undersized heap or too few GC threads; heavy write load causing long concurrent mark cycles; operators investigating latency spikes.","solutions":["Inspect the log line and StatusLogger output to identify which concurrent phase is slow and the heap usage before/after","Tune GC via jvm11-server.options (e.g. increase heap, adjust G1 heap region size, InitiatingHeapOccupancyPercent, GC threads) or via -Dcassandra.gc_concurrent_phase_warn_threshold_ms if thresholds are too aggressive","If pauses cause coordinator timeouts, investigate memory pressure (huge partitions, memtable sizing) driving long concurrent cycles"],"exampleFix":"// before (jvm-server.options)\n-Xms8G -Xmx8G\n\n// after\n-Xms31G -Xmx31G  # reduce concurrent-cycle frequency on large nodes\n// or relax threshold:\n-Dcassandra.gc_concurrent_phase_warn_threshold_ms=1000","handlingStrategy":"validation","validationCode":"// Threshold sanity check before deploy (gc_concurrent_phase_warn_threshold_in_ms)\nlong warnMs = Long.getLong(\"cassandra.gc_concurrent_phase_warn_threshold_ms\", 500);\nif (warnMs <= 0) System.out.println(\"Concurrent-phase GC warning disabled; long concurrent cycles will be silent\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Size the heap so concurrent mark cycles complete quickly; keep live-heap well below IHOP","Alert on these WARN lines and correlate with coordinator latency metrics","Test GC behavior with production-like load before rollout","Tune G1 (MaxGCPauseMillis, IHOP, region size) rather than raising thresholds to hide the problem"],"tags":["jvm","garbage-collection","performance","logging"],"backgroundTag":"request-timeout","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}