malloc()/free() behavior differs between Debian and Redhat

Posted by StasM on Stack Overflow See other posts from Stack Overflow or by StasM
Published on 2010-03-22T20:22:49Z Indexed on 2010/03/27 1:43 UTC
Read the original article Hit count: 269

I have a Linux app (written in C) that allocates large amount of memory (~60M) in small chunks through malloc() and then frees it (the app continues to run then). This memory is not returned to the OS but stays allocated to the process.

Now, the interesting thing here is that this behavior happens only on RedHat Linux and clones (Fedora, Centos, etc.) while on Debian systems the memory is returned back to the OS after all freeing is done.

Any ideas why there could be the difference between the two or which setting may control it, etc.?

© Stack Overflow or respective owner

Related posts about linux

Related posts about malloc