This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11261] malloc uses excessive memory for multi-threaded applications
- From: "carlos at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 14 Mar 2013 19:03:05 +0000
- Subject: [Bug libc/11261] malloc uses excessive memory for multi-threaded applications
- Auto-submitted: auto-generated
- References: <bug-11261-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=11261
Carlos O'Donell <carlos at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |carlos at redhat dot com
Resolution| |FIXED
--- Comment #15 from Carlos O'Donell <carlos at redhat dot com> 2013-03-14 19:03:05 UTC ---
This should have been fixed by the following commit:
commit 41b81892f11fe1353123e892158b53de73863d62
Author: Ulrich Drepper <drepper@gmail.com>
Date: Tue Jan 31 14:42:34 2012 -0500
Handle ARENA_TEST correctly
I have verified that using `mallopt (M_ARENA_MAX, 1)' that the limit of memory
is bounded by the single arena.
creating 10 threads
allowing threads to contend to create preferred arenas
display preferred arenas
Arena 0:
system bytes = 135168
in use bytes = 2880
Total (incl. mmap):
system bytes = 135168
in use bytes = 2880
max mmap regions = 0
max mmap bytes = 0
allowing threads to allocate 100MB each, sequentially in turn
thread 0 alloc 100MB
thread 0 free 100MB-20kB
thread 4 alloc 100MB
thread 4 free 100MB-20kB
thread 9 alloc 100MB
thread 9 free 100MB-20kB
thread 5 alloc 100MB
thread 5 free 100MB-20kB
thread 2 alloc 100MB
thread 2 free 100MB-20kB
thread 7 alloc 100MB
thread 7 free 100MB-20kB
thread 1 alloc 100MB
thread 1 free 100MB-20kB
thread 8 alloc 100MB
thread 8 free 100MB-20kB
thread 6 alloc 100MB
thread 6 free 100MB-20kB
thread 3 alloc 100MB
thread 3 free 100MB-20kB
Arena 0:
system bytes = 100392960
in use bytes = 201472
Total (incl. mmap):
system bytes = 100392960
in use bytes = 201472
max mmap regions = 0
max mmap bytes = 0
Therefore the solution to a program with lots of threads is to limit the arenas
as a trade-off for memory.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.