Heroku R14 Memory Quota Exceeded Error
Quick answer
R14 means your dyno is using more memory than its quota and has started swapping, which makes the app slow. Reduce worker count and memory use, or move to a bigger dyno.
Most likely fix: Limit process count with WEB_CONCURRENCY
How to fix it
Try these in order — the most common fix is first.
1. Limit process count with WEB_CONCURRENCY
- Run heroku config:set WEB_MEMORY=<MB per process> so Heroku computes WEB_CONCURRENCY
- Or set WEB_CONCURRENCY manually (for example 1 or 2 on a 512 MB dyno)
- Do not size workers by CPU count
Did this fix it?2. Cap the Node heap on older Node
- On Node below 12 set the Procfile to: web: node --optimize_for_size --max_old_space_size=460 server.js (for a 512 MB dyno)
- Node 12 and newer base the limit on available memory, so this is usually not needed
Did this fix it?3. Look for a leak
- Check whether memory climbs steadily without more traffic, which points to a leak or a recent code change
- Take heap snapshots with node --inspect locally or heroku ps:forward on staging
- Update dependencies and Node/Ruby version
Did this fix it?4. Restart as a stopgap
- heroku ps:restart -a <app> clears memory until it grows again
- Heroku also restarts dynos daily
Did this fix it?5. Move to a bigger dyno
- Standard-2X has 1 GB, Performance-M has 2.5 GB
- Run heroku ps:type standard-2x -a <app>
- Note the cost: Standard-2X is $50/month
Did this fix it?
Symptoms
Logs show Error R14 (Memory quota exceeded) with memory_total above the quota; the app gets slow, then may restart with R15.
Why it happens
- Too many web processes or threads for the dyno's RAM
- A memory leak that grows with uptime
- Large in-memory data or caches
- Node heap limit set higher than the dyno
- Eco, Basic and Standard-1X dynos only have 512 MB
This guide also covers
- heroku r14 memory quota exceeded
- heroku r14 error
- heroku memory quota vastly exceeded r15
- heroku out of memory
Still not working?
If Heroku keeps failing, you're not alone. See every Heroku problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to us