Issue
I would like to let the app code to adjust memory usage to avoid R15 - Memory quota vastly exceeded errors but the free
command shows inconsistent results. How can I obtain current memory use and max available memory on a dyno in a Private Space?
Resolution
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. Some of our engineers are aware of the file under the /sys/fs/cgroup/memory/
show expected values around memory available for the dyno.