- Newest
- Most votes
- Most comments
When you're experiencing the "Build is consuming more memory. Retrying with a larger instance" error in AWS App Runner, it's indicating that your application's build process requires more memory than initially allocated.
Unfortunately, App Runner currently doesn't provide a direct way to specify the build instance size upfront. The service automatically determines the required resources and will retry with a larger instance when it detects memory constraints.
This behavior is similar to what happens in other AWS build services. For example, in AWS Amplify Hosting, they recently introduced customizable build instances (Large and XLarge sizes) to address similar memory issues during builds. With Amplify, you can now select the computing resources that best match your application needs to avoid resource constraints.
For your App Runner issue, you might try these workarounds:
- Optimize your build process to reduce memory usage
- Consider breaking down your project into smaller sub-projects if possible
- If your build involves Node.js, you could try setting NODE_OPTIONS to limit memory usage (similar to how it's done in Amplify)
While App Runner doesn't currently offer the ability to pre-select a larger build instance, this is valuable feedback that could be submitted as a feature request to AWS. For now, you'll need to account for the additional build time caused by the automatic retry with a larger instance.
Sources
Introducing Upgraded Build Instances on Amplify Hosting | Front-End Web & Mobile
Build phase - Development and Test on Amazon Web Services
answered a year ago
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 10 months ago

I've already optimized the build as much as possible and are using NODE_OPTIONS to specify mem. Guess will need to find another solution than AppRunner - maybe GitHub Actions + ECS