{"record":{"id":"0f02f9c7a2faafc7","repo":"oracle/graal","slug":"out-of-memory-during-live-set-allocation-of-size","errorCode":null,"errorMessage":"Out-of-memory during live set allocation of size %d","messagePattern":"Out-of-memory during live set allocation of size (.+?)","errorType":"exception","errorClass":"PermanentBailoutException","httpStatus":null,"severity":"warning","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java","lineNumber":287,"sourceCode":"                            op.visitEachOutput(defConsumer);\n                        }\n                    } // end of instruction iteration\n\n                    BlockData blockSets = allocator.getBlockData(block);\n                    blockSets.liveGen = new SparseBitSet(liveGenScratch);\n                    blockSets.liveKill = new SparseBitSet(liveKillScratch);\n                    blockSets.liveIn = new SparseBitSet();\n                    blockSets.liveOut = new SparseBitSet();\n\n                    if (debug.isLogEnabled()) {\n                        debug.log(\"liveGen  B%d %s\", block.getId(), blockSets.liveGen);\n                        debug.log(\"liveKill B%d %s\", block.getId(), blockSets.liveKill);\n                    }\n\n                }\n            } // end of block iteration\n        } catch (OutOfMemoryError oom) {\n            throw new PermanentBailoutException(oom, \"Out-of-memory during live set allocation of size %d\", liveSize);\n        }\n    }\n\n    private boolean verifyTemp(SparseBitSet liveKill, Value operand) {\n        if (allocator.isDetailedAsserts()) {\n            /*\n             * Fixed intervals are never live at block boundaries, so they need not be processed in\n             * live sets. Process them only in debug mode so that this can be checked\n             */\n            if (isRegister(operand)) {\n                if (allocator.isProcessed(operand)) {\n                    liveKill.set(getOperandNumber(operand));\n                }\n            }\n        }\n        return true;\n    }\n","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java#L269-L305","documentation":"Thrown at the end of computeLocalLiveSets when building the per-block SparseBitSets (liveGen/liveKill/liveIn/liveOut) runs out of memory. Like the BitMap2D failure, the linear-scan lifetime analysis phase wraps the OutOfMemoryError into a PermanentBailoutException, reporting allocator.liveSetSize() so you can tell whether the method is truly too large or the JVM just lacked heap.","triggerScenarios":"Any `new SparseBitSet(...)` inside the block-iteration loop throwing OutOfMemoryError while computing local live sets — methods with very large live-variable sets across many blocks (huge methods after inlining and LIR generation).","commonSituations":"Compiling mega-methods under a memory-capped JVM; containers with low heap limits; Graal compilation threads competing for memory with a big application heap — the reported live-set size versus actual -Xmx tells you which case you are in.","solutions":["Increase available heap (-Xmx / reduce compilation-thread memory pressure) if the live-set size is plausible for the method.","Split or simplify the giant method so its live sets shrink.","As a workaround, exclude the method from Graal compilation via -XX:CompileCommand=exclude."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// permanent bailout wrapping OutOfMemoryError; increase heap or shrink the method.\n// The reported live-set size tells you which side of the tradeoff you are on.","preventionTips":["Give compilation threads enough heap in containers (avoid tight -Xmx near live-set sizes).","Reduce live-range sprawl by splitting huge methods before JIT-sensitive deployments."],"tags":["graalvm","register-allocation","lsra","out-of-memory","bailout"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}