ARM / Linux memory leak: can a custom program save memory after termination?

I have a memory leak somewhere, but it doesn't seem to be related to my program. I make this bold expression based on the fact that once my program finishes, either by seg-faulting, exits or is interrupted, the memory will not be reclaimed. If my program was the culprit, I would assume the MMU would restore everything, but that doesn't seem to be the case.

My question is:

On a small Linux system (64MB Ram) that runs a program that only uses the memory stack and a few calls to malloc()

, what reasons can I look for too much for the memory to start and stay nonstop after my program finishes?

A related question here :


It all started when after said code sent it to stdout, stderr to file. After a few hours, it aborted with "Segmentation Fault". A quick (naive?) Look at / proc / meminfo showed that there isn't much memory, so I assumed there was something leaking.

0


source to share


1 answer


I don't seem to have a memory leak (see here ), but that leads me to some new questions ...


It turns out that writing to blocking devices can use quite a lot of physical memory; I only had 64 megabytes on my system, so writing hundreds of Megs on a USB stick resulted in a massive increase in cached, active and inactive memory pools.



These memory pools are immediately freed to the free memory pool when the device is shut down.

The exact cause of my segmentation fault remains a bit of a mystery, but I know it can be mitigated by better understanding virtual memory resources, especially around block devices.

0


source







All Articles