[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
incorrect malloc_stats output
From: |
Prem Gopalan |
Subject: |
incorrect malloc_stats output |
Date: |
Mon, 18 Aug 2003 17:11:23 -0400 (EDT) |
>Submitter-Id: net
>Originator: root
>Organization:
<organization of PR author (multiple lines)>
>Confidential: no
>Synopsis: <synopsis of the problem (one line)>
>Severity: <[ non-critical | serious | critical ] (one line)>
>Priority: <[ low | medium | high ] (one line)>
>Category: libc
>Class: <[ sw-bug | doc-bug | change-request | support ] (one
line)>
>Release: libc-2.3.2
>Environment:
<machine, os, target, libraries (multiple lines)>
Host type: i386-redhat-linux-gnu
System: Linux tm11-2.mazunetworks.com 2.4.18 #2 SMP Mon Aug 18 05:40:35
EDT 2003 i686 i686 i386 GNU/Linux
Architecture: i686
Addons: linuxthreads
Build CFLAGS: -march=i386 -DNDEBUG=1 -finline-limit=2000 -g -O3
Build CC: gcc
Compiler version: 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Kernel headers: 2.4.18
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
>Description:
malloc_stats shows incorrect memory usage for Arena 0 after sbrk()
memory is utilized. malloc_stats is output every 1 seconds from a thread.
Once Arena 0 reaches its limit of 1GB (TASK_UNMAPPED_BASE) malloc_stats
output shows a large incorrect value (1.54Gb) for system bytes and in use
bytes (which affects Total). The actual total memory usage here is about
1.5 - 1.6Gb (as reported by top) instead of 2.1gb.
Arena 0:
system bytes = 848936380
in use bytes = 848935740
Arena 1:
system bytes = 446341120
in use bytes = 446337056
Total (incl. mmap):
system bytes = 1417297340
in use bytes = 1417292636
max mmap regions = 15
max mmap bytes = 122019840
Arena 0:
system bytes = 1534700988
in use bytes = 1534490044
Arena 1:
system bytes = 446341120
in use bytes = 446339552
Total (incl. mmap):
system bytes = 2103061948
in use bytes = 2102849436
max mmap regions = 15
max mmap bytes = 122019840
Secondly, the memory does seem to be allocated from main arena (sbrk'ed?)
although TASK_UNMAPPED_BASE is supposed to limit it to 1GB. What is
happening here ?? I ran a simple single threaded program that continually
allocates memory and found main arena could exceed 1GB. Is that expected ?
However, the above is independent of the bug. malloc_stats actually ends
up going to 4.5GB or so on my 4GB box. The Total below of 3.67Gb is
ridiculous as user space ends at 3GB.
Arena 0:
system bytes = 2995479196
in use bytes = 2994988452
Arena 1:
system bytes = 50745344
in use bytes = 50739752
Arena 2:
system bytes = 208867328
in use bytes = 208865872
Arena 3:
system bytes = 171769856
in use bytes = 171767664
Total (incl. mmap):
system bytes = 3670499996
in use bytes = 3670000012
max mmap regions = 29
max mmap bytes = 243638272
>How-To-Repeat:
A simple pthreads based program that allocates and deallocates large
amounts of memory shd suffice to reproduce it.
>Fix:
<how to correct or work around the problem, if known (multiple
lines)>
- incorrect malloc_stats output,
Prem Gopalan <=