Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens when Heroku runs out of memory?

I've been getting heroku low-memory errors for a Ruby on Rails app. What exactly happens if this occurs?

like image 996
Will Taylor Avatar asked Apr 16 '15 13:04

Will Taylor


People also ask

How much RAM does Heroku offer?

Heroku memory limitsfree , hobby , and standard-1X dynos can use 512 MB of memory, while standard-2X dynos have access to 1 GB. performance-M and performance-L dynos provide 2.5 and 14 GB of memory. Memory use over these limits writes to disk at much slower speeds than direct RAM access.

How do I check Heroku RAM usage?

Please refer to the files /sys/fs/cgroup/memory/memory. usage_in_bytes and /sys/fs/cgroup/memory/memory. limit_in_bytes . Dynos for Heroku apps run in containers while some of Linux tools, like the free command, refers to metrics from the underlying instance.


1 Answers

First, you'll receive an R14 error, warning you about exceeding the memory quota for your application. You'll likely see your application starting to grind down to a halt.

R14 - Memory quota exceeded

A dyno requires memory in excess of its quota (512MB on 1X dynos, 1024MB on 2X dynos, 6GB on PX dynos). If this error occurs, the dyno will page to swap space to continue running, which may cause degraded process performance.

https://devcenter.heroku.com/articles/error-codes#r14-memory-quota-exceeded

If your application continues to consume more memory beyond this point, you'll receive an R15 error, and your application will be killed.

R15 - Memory quota vastly exceeded

A dyno requires vastly more memory than its quota and is consuming excessive swap space. If this error occurs, the dyno will be killed by the platform.

https://devcenter.heroku.com/articles/error-codes#r15-memory-quota-vastly-exceeded

Note that it says killed, which means your application will most likely be offline at this moment and until you take further action.

like image 188
Drenmi Avatar answered Sep 29 '22 01:09

Drenmi