Re: PROBLEM: malloc can alloc more memory that Linux really has

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Wed Jul 05 2000 - 10:10:02 EST


On Wed, 5 Jul 2000, Igor Oblakov wrote:

> Hi,
>
> 1. malloc can alloc more memory that Linux really has

Of course. malloc() is not part of Linux. It usually just sets the
break address. This is what it's supposed to do. Allocations occur
on a page-by-page basis when there kernel page-faults. This is how
virtual memory works.

If your programs insist on allocating all the memory in the world, they
will fail. If you have 'N' programs that allocate 'X' bytes of data,
you need N*X + overhead of swap space, to handle the allocations.

Cheers,
Dick Johnson

Penguin : Linux version 2.2.15 on an i686 machine (797.90 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

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



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:16 EST