Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Apr 1995 10:46:00 -0700
From:      nate@sneezy.sri.com (Nate Williams)
To:        Kai.Vorma@hut.fi
Cc:        hackers@FreeBSD.org
Subject:   Re: Two proposals
Message-ID:  <199504011746.KAA19377@trout.sri.MT.net>
In-Reply-To: <199504011554.SAA10589@vinkku.hut.fi>
References:  <199504011554.SAA10589@vinkku.hut.fi>

next in thread | previous in thread | raw e-mail | index | archive | help
> 2) Malloc
> 
>   I installed few days ago Netscape-1.1b. It is a nice program, but
>   quite memory hungry and makes your X-server fat, too.
> 
>   I relinked my X-server (XFree86-3.1.1) with gnumalloc and its memory
>   usage (VSZ) dropped from 7MB to 4MB! It seems, that the standard
>   FreeBSD malloc wastes memory quite liberally. The VM-system probably
>   can reclaim some (most?) of those wasted pages, but not all.

Correct, the default BSD malloc library is a pig.  However, back in the
1.1.5 days I brought in a new version of malloc() by Mark Moraes which
was going to replace the default version.  However, due to some
employment problems that occurred during the 1.X -> 2.0 transition I
wasn't able to do the work, so that malloc version got lost.

And, there were occasional stories of strange core-dumps that were
caused by that version which would go away if the old version or the GNU
version were used.  However, I'm not completely convinced that the
Moraes malloc was the cause of them.  I think it may have triggered a
VM bug that the others didn't.

>   I think we should search for better mallocs. I found 3 promising packages:
> 
>    o GnuMalloc

Nope.  I don't want to taint *all* of our binaries with GNU malloc.

>    o CSRI malloc V1.17 (alpha?)

Don't know about this one

>    o Malloc-2.5.3b by Doug Lea

Don't know about this one either.  We also need to consider

     o Mark Moraes malloc from 1.1.5 which is in ports

>   We already have (an old version of) gnumalloc in separate library but
>   I would like to see something integrated into libc. I tried
>   Malloc-2.5.3b for a few days but it broke sed so I had to give up.
> 
>   I think FreeBSD-1.1.5 had some older version of CSRI malloc as
>   libmalloc. The CSRI malloc seems to be very space efficient but
>   perhaps a bit slow. I haven't (yet) tried to replace libc malloc
>   with CSRI malloc.

Is that the CSRI malloc?  I wasn't aware of that.  As far as slow goes,
benchmarks Righ Murphy did a while ago put it *much* faster than our
current malloc and not much slower than GNU malloc.  (And I think once
it was faster than GNU malloc).  I'd prefer something that was more
space effecient that wasn't *really* slow vs. something that was a bit
faster but wasn't quite as effecient.

In the information distributed with Moraes malloc(), he explains that it
should be much leaner than the stock BSD malloc and it should be as fast
as the GNU malloc routine.  However, I haven't benchmarked these claims
myself so I can't say.

If you could take the time to test the system using it, I would be
grateful.  Also, if the core folks don't mind I'd like to bloat the tree
and bring libmalloc back into the tree so that we could replace the
stock malloc with it.  Bringing it into the tree makes it easier for
folks to test it out.


Nate





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