Re: memory allocations.



On 28 Feb 2002, Ulrich Drepper wrote:

> Havoc Pennington <hp redhat com> writes:
> 
> > We could pool them by just forcing them all to the same length, maybe,
> > though the length is in principle arbitrary.
> 
> Whatever the way will be, this code is executed at startup time.
> There will be no second thread handling this code so you don't have to
> lock at all.
> 
> For this specific problem (many small allocations which never will be
> freed) obstacks are ideal.

Well, as I see it the problem with optimising malloc for startup times is
that according to my profiling, at most 1% time of total is spent in
malloc during startup of say gedit, while in real use - I opened a 300KB+
text file and page-downed to the end - the use grew to 3% of time. 

But this is on admitedly on solaris, not linux.

> 
> -- 
> ---------------.                          ,-.   1325 Chesapeake Terrace
> Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
> Red Hat          `--' drepper at redhat.com   `------------------------
> 

	Sander

	I see a dark sail on the horizon
	Set under a dark cloud that hides the sun
	Bring me my Broadsword and clear understanding





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]