Re: sbrk(2) broken

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Fri, 04 Jan 2008 12:57:11 +0000
In message <20080104122149.GA17103_at_nagual.pp.ru>, Andrey Chernov writes:
>On Wed, Jan 02, 2008 at 10:38:40PM -0800, Jason Evans wrote:
>> Poul-Henning noticed today that xchat fails to start if malloc uses sbrk 
>> internally.  
>
>Malloc() itself knows about memory amount _really_ in use by a program [...]

No, the VM system has a much better idea about this.

You need to think about this the right way:

There is address space allocated to the process (via sbrk/mmap)

A subset of this, is address space allocated by the program (via malloc)

...and then there is memory actually in use, which is an entirely different
thing, of which we currently only have some kind of clue in the VM
system.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Fri Jan 04 2008 - 11:57:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:24 UTC