Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: mjr@hussar.dco.dec.com (Marcus J. OpenRanum)
Subject: Re: lmalloc advantages
Date: Mon, 9 Mar 1992 02:12:25 GMT	[thread overview]
Message-ID: <1992Mar9.021225.8063@decuac.dec.com> (raw)
In-Reply-To: 1616@pvi.UUCP

ncar!pvi!james() writes:

>By including -lmalloc they say the process can malloc more 
>memory. Any advice on the advantages of including -lmalloc
>would be greatly appreciated.  

	I don't know anything about allocating more or less memory
with different versions of malloc() - however:

	-lmalloc uses a binary lazy buddy allocation scheme - it's
	very quick for allocating small objects, but uses more memory
	as it works.

	-lmalloc has a variety of ways that you can pass "hints" to
	the allocator to tell it what size objects to optimize for.
	these hints aren't supported with the default malloc(), so
	you're writing nonportable code if you use these. I personally
	prefer using something like my own memory allocation profiler
	to see what the hell's going on - it's malloc-independent.

	-since the -lmalloc malloc() uses more space to allocate the
	same amount of objects, I'd expect you'd actually be able to
	allocate more memory with the default malloc().

	-in some circumstances (that I have measured - a C++ program
	that allocates manymanymany things) the -lmalloc is 3-6X
	faster than the default one.

	-on the other hand, the in-core image was almost 2Mb larger.

	Depending on what your application does, its allocation patterns,
how often stuff is allocated/freed, sizes of objects, etc, etc (all crucial
information you do not provide) it's hard to give a meaningful answer, just
these observations.

	Why do you care? Have you profiled your application and noticed it
is spending a lot of time in malloc()? Or is it using too much core? What
problem are you trying to solve?

mjr.
-- 
	Theoretical computer scientist: about as useful as a theoretical
ditch-digger, but more widely published.
					- notebooks of a heretic.


  reply	other threads:[~1992-03-09  2:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-03-09  0:46 lmalloc advantages James Phillips x308
1992-03-09  2:12 ` Marcus J. OpenRanum [this message]
1992-03-09  3:09 ` Nelson Minar
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox