{"record":{"id":"8615ba2da3dec38c","repo":"apache/cassandra","slug":"a-repair-session-space-of-mebibytes-is-likely-t","errorCode":null,"errorMessage":"A repair_session_space of {} mebibytes is likely to cause heap pressure","messagePattern":"A repair_session_space of (.+?) mebibytes is likely to cause heap pressure","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":781,"sourceCode":"        {\n            logger.warn(\"repair_session_max_tree_depth has been deprecated and should be removed from cassandra.yaml. Use repair_session_space instead\");\n            if (conf.repair_session_max_tree_depth < 10)\n                throw new ConfigurationException(\"repair_session_max_tree_depth should not be < 10, but was \" + conf.repair_session_max_tree_depth);\n            if (conf.repair_session_max_tree_depth > 20)\n                logger.warn(\"repair_session_max_tree_depth of \" + conf.repair_session_max_tree_depth + \" > 20 could lead to excessive memory usage\");\n        }\n        else\n        {\n            conf.repair_session_max_tree_depth = 20;\n        }\n\n        if (conf.repair_session_space == null)\n            conf.repair_session_space = new DataStorageSpec.IntMebibytesBound(Math.max(1, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576))));\n\n        if (conf.repair_session_space.toMebibytes() < 1)\n            throw new ConfigurationException(\"repair_session_space must be > 0, but was \" + conf.repair_session_space);\n        else if (conf.repair_session_space.toMebibytes() > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))\n            logger.warn(\"A repair_session_space of \" + conf.repair_session_space + \" mebibytes is likely to cause heap pressure\");\n\n        checkForLowestAcceptedTimeouts(conf);\n\n        long valueInBytes = conf.native_transport_max_frame_size.toBytes();\n        if (valueInBytes < 0 || valueInBytes > Integer.MAX_VALUE - 1)\n        {\n            throw new ConfigurationException(String.format(\"native_transport_max_frame_size must be positive value < %dB, but was %dB\",\n                                                           Integer.MAX_VALUE,\n                                                           valueInBytes),\n                                             false);\n        }\n\n        if (conf.column_index_size != null)\n            checkValidForByteConversion(conf.column_index_size, \"column_index_size\");\n        checkValidForByteConversion(conf.column_index_cache_size, \"column_index_cache_size\");\n        checkValidForByteConversion(conf.batch_size_warn_threshold, \"batch_size_warn_threshold\");\n\n        // if data dirs, commitlog dir, or saved caches dir are set in cassandra.yaml, use that.  Otherwise,","sourceCodeStart":763,"sourceCodeEnd":799,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L763-L799","documentation":"repair_session_space bounds the total memory usable by concurrent repair sessions. DatabaseDescriptor warns when the configured value exceeds one quarter of the JVM max heap (maxMemory / 4 mebibytes), since committing that much heap to Merkle trees can cause GC pressure or OOM during large repairs. Values < 1 MiB are rejected outright with a ConfigurationException.","triggerScenarios":"cassandra.yaml sets repair_session_space to a value whose mebibyte amount is greater than Runtime.maxMemory() / (4 * 1048576); applySimpleConfig logs the heap-pressure warning.","commonSituations":"Operators raising repair_session_space on heaps that were later shrunk (e.g. container memory limits reduced), or copying configs from larger nodes to smaller ones.","solutions":["Reduce repair_session_space to at most ~25% of the JVM max heap (a common safe choice is maxMemory/16, the default)","Increase -Xmx / container memory if genuinely more repair memory is needed","Rely on the default (maxMemory/16) by removing the explicit setting"],"exampleFix":"# before (heap 8 GiB)\ncassandra.yaml:\n  repair_session_space: 4096MiB\n# after\ncassandra.yaml:\n  repair_session_space: 512MiB","handlingStrategy":"validation","validationCode":"long maxHeapMiB = Runtime.getRuntime().maxMemory() / (1024 * 1024);\nif (config.repair_session_space != null && config.repair_session_space.toMebibytes() > maxHeapMiB / 4) {\n    logger.warn(\"repair_session_space {} exceeds 25% of heap ({} MiB); reduce it\", config.repair_session_space, maxHeapMiB);\n}","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.applySimpleConfig(conf); } catch (ConfigurationException e) { /* < 1 MiB rejected here */ }","preventionTips":["Keep repair_session_space at or below maxMemory/16 (the default)","Re-check the value whenever JVM heap or container limits change","Avoid copying large-node yaml to small nodes without resizing heap-derived settings"],"tags":["cassandra","config","repair","heap","memory"],"backgroundTag":"invalid-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"}