This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Enhancing malloc


On Wed, May 29, 2013 at 03:02:25PM +0200, Florian Weimer wrote:
> On 05/29/2013 02:53 PM, Will Newton wrote:
> 
> >>Other things to consider are fork friendliness and the impact of buffer
> >>overruns and double-free bugs in application programs in terms of actual
> >>security vulnerabilities.
> >
> >What do you mean by "fork friendliness" in this context?
> 
> The metadata updates performed by malloc/free can trigger copying of
> pages shared between the parent and child processes.  An obvious
> candidate for such behavior is a hash table keyed by the pointer
> returned by malloc.  Under this criterion, schemes which do not
> colocate metadata with object data tend to fare less well than
> schemes which do.
>
I am more concerned of copying of shared pages triggered by malloc.

A memory is most of time fragmented. Assume that significant part of
allocations were less than page large. When malloc allocates memory into
that gap then subsequent code that initializes that memory triggers copy
on write. When parent/child keep allocating memory it is matter of time
until everything is copied. 

Here less fragmentation mean less copying.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]