Hey Goetz,

2008/11/24 Goetz Babin-Ebell <[EMAIL PROTECTED]>:
>> That is okay. But, those are mapped memory, not actually used. Mapped
>> memory does not consume memory until it is actually used (i.e.
>> swapped in).
>
> And that is the problem:
> It is an embedded device, which means no swap.
> And unfortunately with all the running applications and modules
> we reached the limit at which every additionally used K can mean
> an oops...

The way I understand it, linux overcommits memory: malloc() will
succeed, memory will be mapped for the process, but pages will only
get allocated when the memory is effectively used (by reading or
writing). This means that the totally mapped memory used by all
processes together in your system may easily exceed the total amount
of physical memory.

I would expect this behaviour to be regardless of underlying
architecture (although it can be switched off apparently).

So, in your case, if big contiguous chunks of memory are not used
(such as thread stacks), you should not count them as memory
consumption, even if you have no swap space.

The result of segfaulting on a page that was mapped but is not
currently active in memory, has as usual consequence the "swapping in"
of the page, since this is the exactly same mechanism used when having
swap space. But in your case, for a new page it does not involve
actual swap space, since no content was provided yet for the page.

Ofcourse you should be sparing with memory, but therefore it is even
more important to understand the actually used memory resources. If
you would have the ability to build your application also on i386 I
would recommend using valgrind to do some profiling.

Regards,
koen

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to