Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

My Heroku app shows R14 memory errors and gets slow or restarts

Short answer

R14 means the app is using more memory than its dyno allows and Heroku is moving it into swap space, which slows it down. R15 means it is far over and Heroku kills the process. The cause is either a dyno that is too small for the load or a memory leak in the code, and the Metrics tab shows which.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • The logs show Error R14 (Memory quota exceeded).
  • The logs show Error R15 and the app was restarted.
  • Pages get slower the longer the app has been running.
  • A big import, report or image job makes the whole site crawl.
  • Customers get a 503 page now and then.

Why does this happen?

  1. The dyno is too small for the work it does

    Every dyno size has a fixed amount of memory. If the app needs more, the dyno uses swap on disk and performance drops. Heroku lists a dyno that is too small for the workload as a common cause.

  2. R14 is a warning, R15 is the kill

    R14 means the dyno needs more memory than its quota and is paging to swap, so it keeps running but degrades. R15 means it is vastly over quota and the platform stops it with SIGKILL, which the process cannot catch.

  3. A memory leak in the application

    Code that keeps holding on to data, such as growing caches, big result sets or uploaded files kept in memory, makes memory climb until the dyno restarts. Heroku names leaks as the other common cause.

  4. Too many worker processes or big jobs in one dyno

    Each extra process or concurrent job takes its own memory. A setting that was fine at low traffic can exceed the limit later. This is a configuration and code question, not something the owner can see from the dashboard alone.

What can I do about it today?

  1. Open the Metrics tabIn the Heroku dashboard open the app, then Metrics. Look at the memory graph over a few days. Steady climbing that drops at each restart points to a leak. A flat line near the limit points to a dyno that is too small.
  2. Note when the errors happenWrite down the times of the R14 or R15 lines and what was happening: a report, an import, a marketing email, a busy hour.
  3. Ask for the logs, do not guessCopy a few lines of the error from the app's Logs view so a developer can see the exact code.
  4. Do not just keep restarting itA restart clears memory for a while and hides the cause. It is fine as a short pause, not as the plan.
  5. Think before upgrading the dynoA bigger dyno can buy time but raises the monthly bill, and it does not fix a leak. Ask what the memory graph says first.

When should I bring someone in?

  • R15 errors repeat and customers see 503 pages.
  • Memory climbs steadily and nobody on your side can read the code.
  • The app handles payments, orders or uploads where a kill mid-request can lose data.

How do I handle it?

  1. Read the memory graph with the logsI line up the Metrics graph with the R14 and R15 lines to tell a leak from a plain size problem.
  2. Reproduce it away from productionI recreate the load in a copy of the app and measure memory per request or job, so I am not experimenting on your live site.
  3. Fix the heaviest cause firstLarge queries, files held in memory and unbounded caches are changed in the code, and process counts are set to what the dyno can carry.
  4. Size the dyno on evidenceIf a bigger dyno is still needed afterwards, I show the graph that justifies it so the decision is yours.
  5. Watch after releaseI check the memory graph again after the change and keep a way to roll the release back.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Is R14 the same as the app crashing?

No. R14 means the dyno is using swap and getting slower. R15 is where Heroku kills the process.

Will a bigger dyno solve it?

Only if the app simply needs more memory. If memory keeps climbing because of a leak, a bigger dyno delays the same error.

Where do I see memory use?

The Metrics tab of the app in the Heroku dashboard shows memory over time.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.