Ways to reduce memory usage. Delete supervisor?



I’m running balenaOS standalone version on a beaglebone black which has only ~480mb ram, without running any additional containers it already uses ~220mb of ram, as can be seen in the following figure, leaving ~260mb for application.


When I run my complete application the memory consumption floats around ~460mb, eventually if I leave it running for some time I get OOM error and my containers are killed. For that reason, I’m wondering if there are any ways to reduce the memory usage of the balenaOS, since I’m using the standalone version is it necessary to keep the resin_supervisor running? Are there anything that can be stoped?

My setup:



The supervisor is needed if you are planning to push updates to your application.

If you deploy the application just once and don’t update it anymore, then you can disable the supervisor.

This could be done with these commands:
mount -o remount,rw /
systemctl disable resin-supervisor



Note that the resin_supervisor container is in my case using about 40 MB.
Stopping it, assuming you can stop it, would only give you 40 MB more memory to allocate.

When I stop all containers then free reports the following for me:

 root@997563c:~# free
                 total       used       free     shared    buffers     cached
    Mem:        999116     475564     523552      11116      51832     200540
    -/+ buffers/cache:     223192     775924
    Swap:            0          0          0

So I would interpret this as the balena OS (including the 40 MB of the resin_supervisor) requires 220 MB - the rest of the memory is available for the other docker containers.