Hi @wlisac, could connect to the device locally, and see whether it is really running out of memory, or anything else is going on.
I’ve put together a small “hello” project based on what you posted above
And this builds totally fine with
balena push IP, so not everything is running out of memory, at least it seems. I wonder if you want to share your project so we can try it locally as well.
Also, what version of the OS and the CLI are you using?
Using swap is an interesting idea. Currently you would have to do it manually. Probably it would work inside the running device, but the easiest is (since it’s a local device for you), if you take the SD card out, and resize the partitions / create the new ones in your development machine. For example using
gparted, shrink the
resin-data partition, and create a new logical partition of the
linux-swap kind in the freed up space afterwards.
When you start up the device, you’ll have to set
swapon /dev/mmcblk0p7 (if you did as mentioned above, it will be the 7th partition), and that enables swap, you can see it with
swapon -s and
cat /proc/meminfo | grep Swap that it’s in use. Unfortunately on every boot you will have to set this
swapon ... with this device, as it’s not by default using it.
For local development devices it should be okay, I presume? Or what do you think?