Linux BASH memory leak on stdio redirect

I have a memory leak somewhere, but it doesn't seem to be related to my program. I am making this bold expression based on the fact that once my program exits, either in the normal way, or crashed or intermittently, memory is not reclaimed. If my program was the culprit, I would assume the MMU would restore everything, but that doesn't seem to be the case.

The leak comes into play when I redirect stdout (in BASH version 2.05 or 4) to a file, as that's ok:

# my-program 

      

but this is not the case:

# my-program > /mnt/sda1/log-output.txt

      

The speed at which I am typing on the screen is <2Kbps. (The file is on the USB keyboard).

Any ideas?

A related question is here .

+2


source to share


1 answer


Only MemFree says almost nothing.

The Linux locking layer is cached a lot.



You can see how many filesystem (and other) caches are being used in the same / proc / meminfo you mentioned.

+2


source







All Articles