* lmalloc advantages
@ 1992-03-09 0:46 James Phillips x308
1992-03-09 2:12 ` Marcus J. OpenRanum
1992-03-09 3:09 ` Nelson Minar
0 siblings, 2 replies; 3+ messages in thread
From: James Phillips x308 @ 1992-03-09 0:46 UTC (permalink / raw)
First let me apoligize, I know this is probably a RTFM issue.
But my back is against the wall with other problems and I
could really use a quick answer. Some folks are telling us
that we should link our application with the -lmalloc linker
directive. They say the default version of malloc has a
bug/limitation on the amount of memory a process can malloc.
By including -lmalloc they say the process can malloc more
memory. Any advice on the advantages of including -lmalloc
would be greatly appreciated.
thanks in advance
james
Oh BTW, this is an Ultrix 4.2 application.
--
James K. Phillips Sprocket Scientist pvi!james@boulder.colorado.edu
Precision Visuals, Inc. (303) 530-9000
6260 Lookout Rd Boulder - A quaint little town nestled between
Boulder, CO 80301 the ROCKIES and REALITY.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: lmalloc advantages
1992-03-09 0:46 lmalloc advantages James Phillips x308
@ 1992-03-09 2:12 ` Marcus J. OpenRanum
1992-03-09 3:09 ` Nelson Minar
1 sibling, 0 replies; 3+ messages in thread
From: Marcus J. OpenRanum @ 1992-03-09 2:12 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: lmalloc advantages
1992-03-09 0:46 lmalloc advantages James Phillips x308
1992-03-09 2:12 ` Marcus J. OpenRanum
@ 1992-03-09 3:09 ` Nelson Minar
1 sibling, 0 replies; 3+ messages in thread
From: Nelson Minar @ 1992-03-09 3:09 UTC (permalink / raw)
In article <1616@pvi.UUCP> ncar!pvi!james() writes:
>First let me apoligize, I know this is probably a RTFM issue.
Only if TFM has the answer.. It is more properly a comp.unix.ultrix
issue.
>[Ultrix 4.2]
>Some folks are telling us that we should link our application with the
>-lmalloc linker directive. They say the default version of malloc has
>a bug/limitation on the amount of memory a process can malloc. By
>including -lmalloc they say the process can malloc more memory.
I don't know anything about -lmalloc, but the standard Ultrix malloc
can be wasteful. I am working with a simulator that tends to create
and destroy lots of data structures, a 500 byte malloc and a 3000 byte
malloc. Ultrix malloc was essentially using 8k for those two things,
while GNU malloc was just as fast and was only using 4k per structure.
GNU malloc seems to be about as fast, is free, and you get source.
The version I used came out of the emacs sources.
--
__
nelson@reed.edu \/ The piper pulled down the sky
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1992-03-09 3:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1992-03-09 0:46 lmalloc advantages James Phillips x308
1992-03-09 2:12 ` Marcus J. OpenRanum
1992-03-09 3:09 ` Nelson Minar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox