Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 1996 15:49:42 -0500
From:      "Garrett A. Wollman" <wollman@lcs.mit.edu>
To:        Steven Wallace <swallace@ece.uci.edu>
Cc:        freebsd-bugs@freebsd.org
Subject:   malloc() prob in 2.1R?
Message-ID:  <9602162049.AA21188@halloran-eldar.lcs.mit.edu>
In-Reply-To: <199602162007.MAA11841@newport.ece.uci.edu>
References:  <199602162007.MAA11841@newport.ece.uci.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Fri, 16 Feb 1996 12:07:41 -0800, Steven Wallace <swallace@ece.uci.edu> said:

> I tried running a testswap program that simply continues to malloc
> a page (4K) of memory until it dies.  At any point I suspend the program
> and check it with ps, ps reports a VSZ twice which I have allocated
> with malloc!

Not at all surprising.  The memory allocator in 2.1 allocates memory
for the next power of two greater than or equal to (size +
malloc_overhead).  So, the next power of two greater than or equal to
(4096 + a_small_amount) is 8192.  -current uses a different allocator
and doesn't over-allocate in this way.

-GAWollman

--
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@lcs.mit.edu  | Shashish is the bonding of hearts in spite of distance.
Opinions not those of| It is a bond more powerful than absence.  We like people
MIT, LCS, ANA, or NSA| who like Shashish.  - Claude McKenzie + Florent Vollant



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9602162049.AA21188>