Re: ideas for returning memory to the OS

Colin Barrett <[email protected]> Tue, 11 Dec 2007 13:06:48 -0800
Newsgroups gmane.comp.mozilla.performance
Message-ID <[email protected]>
Enrico Weigelt wrote:
> Well, if you need an some allocator with different semantics
> (right, there are valid reasons, eg. for zoned allocators, 
> garbage collection, etc, which is not provided by posix malloc)
> why not simply implementing this as an *separate* package ? 

Is this a packaging issue or a resources issue? It's not like we are 
writing our *own* malloc implementation from scratch. We are looking at 
custom allocators, see stuart's blog, and thinking about ways to tune 
those to better meet our specific needs.

Writing and tuning a general purpose allocator is not our core 
competency, you are right. However, we do have a pretty good 
understanding of our own memory uses and as we learn more about how 
allocators work and how we might tune ours, we learn things to do and 
avoid that aren't even related to malloc at all (arenas, pools, separate 
heaps).

As far as packaging goes, Mozilla has in general been poor about 
creating reusable code packaged for use by others, often, I suspect, 
because we are in a very competitive market. How long did it take you to 
  develop that reference counting system? Would it have been quicker to 
just bolt it straight on?

I'm not saying that will always be always the right choice, but 
sometimes time is of the essence.

-Colin