Heap memory is not re-claiming.
From: Jeff Donner <hidden>
Date: 2011-10-13 10:24:03
quoted
On Thu, Oct 13, 2011 at 1:26 AM, V.Ravikumar [off-list ref] wrote:quoted
I've a daemon process and I'm allocating heap memory for big character buffers using malloc/free. Each can take 5MB. Though I freed/deleted memory allocated for the buffers, the increased memory during the allocation time is not re-claiming back.This I observed using top command.Yes, I think it's glibc - it may keep your memory, with the idea that you'll request it again soon anyway.?? If this is the case then memory should not keep on increase albeit how long process may run. right?
Right. That's a memory leak, or else you're just not freeing what you think you are. It's a user-land program, right? 'valgrind' is awesome for finding leaks and memory still allocated. If it really isn't your program losing memory someone else will have to jump in but, I can't imagine any reason a non-broken kernel would accumulate resources.