Re: malloc problem to allocate very large blocks

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Tue Jul 29 2003 - 06:52:51 EST


On Maw, 2003-07-29 at 05:58, Nagendra Singh Tomar wrote:
> AFAIK malloc will not return you memory more than the total virtual memory
> (RAM+swap) in the system. So if you want more than 2GB allocations from
> malloc, make sure you have at least 2GB virtual mem, keeping aside some
> space for the kernel.

On the default memory settings it may do. However a request for 2Gb of
memory requires there is a free 2Gb of address space to map it into -
which may not be true because of things like shared libraries.

The actual total allocatable limit for x86 is a bit under 3Gb, but you
won't get that as one linear allocation. (1Gb is kernel mappings)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:40 EST