Dyno Memory Behavior
Last updated October 16, 2024
Table of Contents
Memory Behavior
The maximum amount of RAM available to your application depends on the dyno size you use. The dyno manager restarts your dyno and logs an R15 error when the memory usage reaches the following limits for each dyno size:
- Eco, Basic or Standard-1X dyno: 1 GB, two times its quota.
- Standard-2X dyno: 2 GB, two times its quota.
- Performance-M dyno: 5 GB, two times its quota.
- Performance-L dyno: 28 GB, two times its quota.
- Performance-L-RAM dyno: 36 GB, 1.2 times its quota.
- Performance-XL dyno: 74 GB, 1.2 times its quota.
- Performance-2XL dyno: 151 GB, 1.2 times its quota.
- Private-S or Shield-S dyno: its quota of 1 GB.
- Private-M or Shield-M dyno: its quota of 2.5 GB.
- Private-L or Shield-L dyno: its quota of 14 GB.
- Private-L-RAM or Shield-L-RAM dyno: its quota of 30 GB.
- Private-XL or Shield-XL dyno: its quota of 62 GB.
- Private-2XL or shield-2XL dyno: its quota of 126 GB.
Using a dyno size that’s too small can cause constant memory swapping, which degrades application performance. Application metrics data, including memory usage, is available via the Metrics
tab of the Heroku Dashboard. You can also measure memory with log-runtime-metrics. Memory leaks in your app can also cause usage problems. If you suspect a memory leak, try using memory profiling tools.
Swap isn’t available on all dynos in Private Spaces, for example. Private-M. Dynos that vastly exceed their memory quota typically emit R15 errors without using swap space. Instead, the platform kills processes consuming large amounts of memory, but may not kill the dyno itself.
Using small amounts of swap space and infrequent memory swapping are usually not problematic. Even when your application hasn’t reached its memory limit, it’s common to see small amounts of memory being swapped to disk as the operating system manages memory and available disk cache.