{"record":{"id":"04b58c94c216c3a9","repo":"oracle/graal","slug":"inline-all-calls-failed-the-resulting-graph-is-to","errorCode":null,"errorMessage":"Inline all calls failed. The resulting graph is too large.","messagePattern":"Inline all calls failed\\. The resulting graph is too large\\.","errorType":"exception","errorClass":"PermanentBailoutException","httpStatus":null,"severity":"warning","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java","lineNumber":42,"sourceCode":" */\npackage jdk.graal.compiler.phases.common.inlining.policy;\n\nimport static jdk.graal.compiler.core.common.GraalOptions.MaximumDesiredSize;\n\nimport jdk.graal.compiler.core.common.GraalOptions;\nimport jdk.graal.compiler.core.common.PermanentBailoutException;\nimport jdk.graal.compiler.nodes.StructuredGraph;\nimport jdk.graal.compiler.nodes.spi.Replacements;\nimport jdk.graal.compiler.phases.common.inlining.InliningUtil;\nimport jdk.graal.compiler.phases.common.inlining.info.InlineInfo;\nimport jdk.graal.compiler.phases.common.inlining.walker.MethodInvocation;\n\npublic class InlineEverythingPolicy implements InliningPolicy {\n\n    @Override\n    public boolean continueInlining(StructuredGraph graph) {\n        if (InliningUtil.getNodeCount(graph) >= MaximumDesiredSize.getValue(graph.getOptions())) {\n            throw new PermanentBailoutException(\"Inline all calls failed. The resulting graph is too large.\");\n        }\n        return true;\n    }\n\n    @Override\n    public Decision isWorthInlining(Replacements replacements, MethodInvocation invocation, InlineInfo calleeInfo, int inliningDepth, boolean fullyProcessed) {\n        boolean isTracing = GraalOptions.TraceInlining.getValue(calleeInfo.graph().getOptions()) || calleeInfo.graph().getDebug().hasCompilationListener();\n        return Decision.YES.withReason(isTracing, \"inline everything\");\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":53,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java#L24-L53","documentation":"InlineEverythingPolicy (used with the -Dgraal.InlineEverything testing option) inlines every call unconditionally. continueInlining (InlineEverythingPolicy.java:42) checks graph size against MaximumDesiredSize each round and throws PermanentBailoutException when the graph grows beyond that limit, aborting the compilation gracefully (the method falls back to a lower tier / interpreter).","triggerScenarios":"Running with -Dgraal.InlineEverything=true on code whose transitively inlined graph exceeds MaximumDesiredSize (default ~10000 nodes), e.g., methods with many self-recursive or mutually recursive callees.","commonSituations":"Using InlineEverything for experiments/benchmarks on large methods; MaximumDesiredSize lowered via option overrides while InlineEverything is on.","solutions":["Raise the limit: add -Dgraal.MaximumDesiredSize=<larger> alongside -Dgraal.InlineEverything=true","Restrict inline-everything to the method(s) of interest via inlining method filters instead of applying it globally","Accept the bailout for oversized methods — it is intentional and only fails this one compilation"],"exampleFix":"# before\njava -Dgraal.InlineEverything=true MyApp\n\n# after\njava -Dgraal.InlineEverything=true -Dgraal.MaximumDesiredSize=50000 MyApp","handlingStrategy":"try-catch","validationCode":"int desired = MaximumDesiredSize.getValue(options);\nif (InliningUtil.getNodeCount(graph) >= desired) { /* expect bailout on next round */ }","typeGuard":null,"tryCatchPattern":"try {\n    result = compile(options); // with -Dgraal.InlineEverything=true\n} catch (PermanentBailoutException e) {\n    // graceful degradation: method stays interpreted / lower tier; optionally retry without InlineEverything\n    result = compile(optionsWithout(InlineEverything));\n}","preventionTips":["Pair -Dgraal.InlineEverything with a generous -Dgraal.MaximumDesiredSize","Restrict inline-everything experiments to small, targeted methods"],"tags":["graal","inlining","bailout","options","graph-size"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}