In article <Pine.LNX.4.10.10002090251410.459-100000@mirkwood.dummy.home> you wrote:
> On Tue, 8 Feb 2000, Lee Chin wrote:
>> Just to make sure I have this correct, an application can call brk
>> to allocate memory from its heap space for upto 1GB, after which
>> it has to switch to using mmap for the rest. Is this 1GB fixed or
>> will it ever change? (if it does, it might break my application).
> IMHO malloc() should switch to mmap() for the rest :)
> None, AFAIK. They use mmap() when you malloc() bigger chunks,
> but they don't use it for smaller chunks when you've run out
> of the first 1GB...
I think this explains some strange behavior I'm seeing. My application
does something like this:
Init:
malloc(120 Mb);
Do some stuff
free(those 120 Mb);
Production: (ie looping)
2x malloc(40Mb)
..
..
2x free(40Mb)
When I use the glibc allocator, the main loop is 5% (0.3 seconds) slower
than when I use "electric fence" to guard/malloc memory. (This is the first
time I see debugging checks making code faster)
My assumption is that electric fence uses brk, while glibc uses mmap.
If my assumption is correct, I hope it is possible to improve the mmap
performance... (those 5% are the difference between meeting the deadline in
our project).
Greetings,
Arjan van de Ven
[1]
Kernel is 2.2.14, I haven't tested a 2.3 kernel with our project, as the NIC
stops functioning after about 1 hour of work
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:14 EST