https://devcenter.heroku.com/articles/limits#dyno-memory
Dynos
Dyno memory
Different dyno sizes offer different amounts of maximum RAM:
- free, hobby and standard-1x have 512 MB
- standard-2x has 1024 MB
- performance-m has 2.5 GB
- performance-l has 14 GB
Dyno memory and restarts
512 MB x 2 = 1 GB), the dyno manager will restart your dyno with an
R15 error.> If the memory size of your dyno keeps growing until it reaches two
times its quota (for a standard-1x dyno,
Your entire app is loaded into memory. Everything you "write to the filesystem" is also written into memory and thus only temporarily exists.
Once you exceed that your Dyno will be forced to restart.
You can circumvent this by using a third party database server which stores all your data. Then you got no more restarts because your memory won't exceed and your data will be persistent.