ENOMEM failure on mmap call

Mulyadi Santosa mulyadi.santosa at gmail.com
Thu Oct 13 12:54:23 EDT 2011


Hi :)

2011/10/13 Ezequiel García <elezegarcia at yahoo.com.ar>:
>
> --- El jue 13-oct-11, Mulyadi Santosa <mulyadi.santosa at gmail.com> escribió:
>
>> this is what I am not clear, do those 10 threads allocate 8
>> MB each?
>> or 8 MB total? remember that threads share address space by
>> default...
>>
>
> I am sorry maybe I explained myself incorrectly, threads don't actually
> allocate anything; just mmap it's own stack space (8MB each).

I see, so 8 MB each.... and since you created 10 threads, I suppose
that would commit 8*10=80 MB of RAM. CMIIW here.... (stack are
individual, so they aren't shared between threads)

> I looked at the link you provided me and I found this:
>
> http://lxr.linux.no/linux+v3.0.4/mm/mmap.c#L112
>
> mmap.c, line 112: vm_enough_memory()
>
> It seems here is where the mm subsystem decides to fail with ENOMEM
> and uses commit parameters to decide... I found it most interesting.

I agree....as you can see there, there is some percentage of VM
preserved for root...also for hugetlb etc.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list