On Thu, Oct 13, 2011 at 2:36 PM, V.Ravikumar <ravikumar.vallabhu@xxxxxxxxx> wrote:
Hi Ravi,If this is the case then memory should not keep on increase albeit how long process may run. right?On Thu, Oct 13, 2011 at 2:12 PM, Jeff Donner <jeffrey.donner@xxxxxxxxx> wrote:
On Thu, Oct 13, 2011 at 1:26 AM, V.RavikumarYes, I think it's glibc - it may keep your memory, with the idea that
<ravikumar.vallabhu@xxxxxxxxx> wrote:
> 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.
you'll request it again soon anyway.
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
When you ask for a memory block, usually by using
malloc()
, you're asking the runtime C library whether a preallocated block is available. This block's size must at least equal the user request. If there is already a memory block available, malloc()
will assign this block to the user and mark it as "used." Otherwise, malloc()
must allocate more memory by extending the heap. All requested blocks go in an area called the heap.Reference to an article by Mulayadi Santosa :-
http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html
AWESOME ARTICLE SIR :)
Regards,
Rohan Puri
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies