On Tue, Oct 18, 2011 at 10:04 AM, V.Ravikumar <ravikumar.vallabhu@xxxxxxxxx> wrote:
Yes I think thats the case.On Sat, Oct 15, 2011 at 9:31 AM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
The leak which I was observed in my program is due to big memory buffers of size 5MB allocation from heap.I've 6 such character buffers.Hi.... :)
On Fri, Oct 14, 2011 at 16:15, pankaj singh <psingh.ait@xxxxxxxxx> wrote:
> Nice doc ...:)
>
> On Fri, Oct 14, 2011 at 10:28 AM, rohan puri <rohan.puri15@xxxxxxxxx> wrote:
>> Reference to an article by Mulayadi Santosa :-Thank you, thank you very much for your appreciation :) I just hope,
>>
>> http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html
>>
>> AWESOME ARTICLE SIR :)
besides getting adequate money, you all got something meaningful from
that article. And I believe, as long as there are people who have same
concerned, that article will be refined over and over and overall will
be better through the time :)
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi,
It's really a fabulous article.
Many many thanks to Mulyadi for such a great article and thank for Rohan for sharing the link.
I read the article and correlate contents with my current issue.
Here are my observations. Do please correct me if I'm wrong at any point.
So as per below lines from the article memory should be allocated with mmap and it immediately releases memory to kernel upon free/delete call from user land process.
The allocator uses two functions to get a chunk of memory from the kernel:
The decision on whether to use
brk()
sets the end of the process's data segment.mmap()
creates a new VMA and passes it to the allocator.brk()
ormmap()
requires one simple check. If the request is equal or larger thanM_MMAP_THRESHOLD
, the allocator usesmmap()
. If it is smaller, the allocator callsbrk()
. By default,M_MMAP_THRESHOLD
is 128KB
But It seems I'm landed with a case which uses brk() for allocation and so it just marks as free when I my program frees the memory and hence 30 MB memory (I've 6 , 5MB buffers from heap)was kept on allocator's control leading to a 30MB leak of user land process.
Please note that I'm freeing memory for 6 buffers (I'm sure about that).
Regards,
Ravi
Regards,
Rohan Puri
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies