When a program or service requests memory from a system then forgets to free the memory, you sometimes need a reboot to free all those allocations. And when memory is tight, fragmentation can waste memory. I sometimes change my C code to reuse memory allocations instead of constantly creating and freeing memory.stopping and restarting all of my services
If you do choose to write your programs in a specific language, look at memory testing for that language. For C, I use valgrind. I do not know the equivalents in other languages. valgrind can run a very slow test where every allocation, malloc (), is tested for a deallocation, free (). For me, C + valgrind is way better than some of the other languages. I can fit into 4 GB programs that otherwise fail in 16 GB.
Yes, coding in C is slower but I started writing some of my code for a Pi Zero.
Statistics: Posted by peterlite — Fri Aug 01, 2025 10:05 am