oracle/graal · warning · PermanentBailoutException
Inline all calls failed. The resulting graph is too large.
Error message
Inline all calls failed. The resulting graph is too large.
What it means
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).
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java:42
*/
package jdk.graal.compiler.phases.common.inlining.policy;
import static jdk.graal.compiler.core.common.GraalOptions.MaximumDesiredSize;
import jdk.graal.compiler.core.common.GraalOptions;
import jdk.graal.compiler.core.common.PermanentBailoutException;
import jdk.graal.compiler.nodes.StructuredGraph;
import jdk.graal.compiler.nodes.spi.Replacements;
import jdk.graal.compiler.phases.common.inlining.InliningUtil;
import jdk.graal.compiler.phases.common.inlining.info.InlineInfo;
import jdk.graal.compiler.phases.common.inlining.walker.MethodInvocation;
public class InlineEverythingPolicy implements InliningPolicy {
@Override
public boolean continueInlining(StructuredGraph graph) {
if (InliningUtil.getNodeCount(graph) >= MaximumDesiredSize.getValue(graph.getOptions())) {
throw new PermanentBailoutException("Inline all calls failed. The resulting graph is too large.");
}
return true;
}
@Override
public Decision isWorthInlining(Replacements replacements, MethodInvocation invocation, InlineInfo calleeInfo, int inliningDepth, boolean fullyProcessed) {
boolean isTracing = GraalOptions.TraceInlining.getValue(calleeInfo.graph().getOptions()) || calleeInfo.graph().getDebug().hasCompilationListener();
return Decision.YES.withReason(isTracing, "inline everything");
}
}
View on GitHub (pinned to a66e9ccd1d)
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
Example fix
# before java -Dgraal.InlineEverything=true MyApp # after java -Dgraal.InlineEverything=true -Dgraal.MaximumDesiredSize=50000 MyApp
Defensive patterns
Strategy: try-catch
Validate before calling
int desired = MaximumDesiredSize.getValue(options);
if (InliningUtil.getNodeCount(graph) >= desired) { /* expect bailout on next round */ } Try / catch
try {
result = compile(options); // with -Dgraal.InlineEverything=true
} catch (PermanentBailoutException e) {
// graceful degradation: method stays interpreted / lower tier; optionally retry without InlineEverything
result = compile(optionsWithout(InlineEverything));
} Prevention
- Pair -Dgraal.InlineEverything with a generous -Dgraal.MaximumDesiredSize
- Restrict inline-everything experiments to small, targeted methods
When it happens
Trigger: 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.
Common situations: Using InlineEverything for experiments/benchmarks on large methods; MaximumDesiredSize lowered via option overrides while InlineEverything is on.
Related errors
- Invalid directed inlining rules file path: {path}
- Could not read directed inlining rules file: {path}
- Number of elements in a node list too high: %d
- Value for {} cannot be empty
- expected phase_name=filter pair in: {}
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/04b58c94c216c3a9.
Report an issue: GitHub.