{"record":{"id":"dc764e1087c156d4","repo":"apache/cassandra","slug":"a-repair-session-space-of-is-likely-to-cause-he","errorCode":null,"errorMessage":"A repair_session_space of {} is likely to cause heap pressure.","messagePattern":"A repair_session_space of (.+?) is likely to cause heap pressure\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":4774,"sourceCode":"                                             \" which is < 10, doing nothing\");\n        else if (depth > 20)\n            logger.warn(\"repair_session_max_tree_depth of \" + depth + \" > 20 could lead to excessive memory usage\");\n\n        conf.repair_session_max_tree_depth = depth;\n    }\n\n    public static int getRepairSessionSpaceInMiB()\n    {\n        return conf.repair_session_space.toMebibytes();\n    }\n\n    public static void setRepairSessionSpaceInMiB(int sizeInMiB)\n    {\n        if (sizeInMiB < 1)\n            throw new ConfigurationException(\"Cannot set repair_session_space to \" + sizeInMiB +\n                                             \" < 1 mebibyte\");\n        else if (sizeInMiB > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))\n            logger.warn(\"A repair_session_space of \" + conf.repair_session_space +\n                        \" is likely to cause heap pressure.\");\n\n        conf.repair_session_space = new DataStorageSpec.IntMebibytesBound(sizeInMiB);\n    }\n\n    public static int getConcurrentMerkleTreeRequests()\n    {\n        return conf.concurrent_merkle_tree_requests;\n    }\n\n    public static void setConcurrentMerkleTreeRequests(int value)\n    {\n        conf.concurrent_merkle_tree_requests = value;\n    }\n\n    public static int getPaxosRepairParallelism()\n    {\n        return conf.paxos_repair_parallelism;","sourceCodeStart":4756,"sourceCodeEnd":4792,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L4756-L4792","documentation":"repair_session_space caps the total memory repair sessions (validation compactions / Merkle trees) may use. If the configured value exceeds roughly max heap / 4, DatabaseDescriptor logs this warning because such a large repair allocation is likely to pressure the JVM heap and cause GC issues or OOM during repair.","triggerScenarios":"Calling DatabaseDescriptor.setRepairSessionSpaceInMiB(sizeInMiB) where sizeInMiB > maxMemory/(4*1048576); values < 1 throw a ConfigurationException instead. Also produced by setting repair_session_space in cassandra.yaml to more than 25% of heap.","commonSituations":"Operators on large-heap nodes bumping repair_session_space to speed repairs, or a shrunk heap after a restart leaving a previously fine value now above the heap/4 threshold.","solutions":["Lower repair_session_space to <= 25% of max heap (compute with java's maxMemory/4MiB)","Increase JVM heap if repair throughput requires more session memory and keep repair_session_space below the new 25% bound","Accept the warning only with explicit heap monitoring during repairs"],"exampleFix":"// before (32GB heap)\nrepair_session_space: 16384MiB\n// after\nrepair_session_space: 8192MiB","handlingStrategy":"validation","validationCode":"int maxMiB = (int)(Runtime.getRuntime().maxMemory() / (4 * 1048576));\nif (cfg.repair_session_space_miB > maxMiB) throw new IllegalArgumentException(\"repair_session_space must be <= \" + maxMiB + \"MiB\");","typeGuard":null,"tryCatchPattern":"try { DatabaseDescriptor.setRepairSessionSpaceInMiB(mib); } catch (ConfigurationException e) { /* < 1MiB rejected */ }","preventionTips":["Cap repair_session_space at 25% of heap","Re-check the value after any heap resize","Load-test repair on a staging node before applying to production"],"tags":["cassandra","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"}