This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Huge chunks of anonymous memory
- From: "Vinu Rajashekhar" <vinutheraj at gmail dot com>
- To: libc-help at sourceware dot org
- Cc: Nix <nix at esperi dot org dot uk>
- Date: Sat, 12 Jul 2008 23:08:56 +0200
- Subject: Huge chunks of anonymous memory
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:mime-version:content-type:content-transfer-encoding :content-disposition; bh=/Adzwqi7ERhu0ysi13uR82p0PJg3dxhCJhigz4wBB0M=; b=Rmsb2vNDNwfod2SxqMCTrl0badNsGOv4nWZRb/tA0OC0fSDAZO38+vj3EyK1bHRDpD 5CAqntjfoMcjkFdYG5Qg+sLsd+zfqzDEzy68K2iZjh6MyrkakORuz91m8af0dsuh+PZO qR9Kj8tRoa3foW/MOAGV0fcjY5e9DHhLje5YM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type :content-transfer-encoding:content-disposition; b=pvXSSF3OxjXoNNbXLZNVvFkyInzHZhz3epUOo1poh9Z+uwlmdLO07LWN7QQNxDxmc+ fgu4hiRPGiNmjXSB8ajebV++p1tNwdibdFB7YYa916FROFlKaGMl/LDqKYKA6nCLV3jd 2sg0kDOC023gP1UvqSyIlYPZY4EcokXPtL5Dw=
Hi,
Hey I tried to run the process with MALLOC_MMAP_THRESHOLD_ as 0
and the huge chunks are still in my mapped memory, and the heap size
remains around the same.
And I tried with the strace thing too, the mempry is not mapped by
mmap or brk or something else.
So then I tried mtrace, muntrace
and grepped the addresses mapped by the same region where these huge
chunks are mapped
and I saw something strange.
00007fbef8000000 536 - - - rw--- [ anon ]
00007fbef8086000 65000 - - - ----- [ anon ]
00007fbf00000000 712 - - - rw--- [ anon ]
00007fbf000b2000 64824 - - - ----- [ anon ]
00007fbf0527d000 6252 - - - rw--- [ anon ]
This is the pmap output ( a part of it showing the huge chunks)
And now look at the grepped mtrace output
ubuntu@ubuntu:~$ cat trace.log | grep 7fbef8086000
@ /home/ubuntu/glibc/local/lib/libstdc++.so.6:(_Znwm+0x25)[0x7fbf06348c1d]
+ 0x7fbef8086000 0xa0
@ /home/ubuntu/glibc/local/lib/libstdc++.so.6:(_ZdlPv+0x1c)[0x7fbf06346c68]
- 0x7fbef8086000
@ /home/ubuntu/glibc/local/lib/libstdc++.so.6:(_Znwm+0x25)[0x7fbf06348c1d]
+ 0x7fbef8086000 0xa0
@ /home/ubuntu/glibc/local/lib/libstdc++.so.6:(_ZdlPv+0x1c)[0x7fbf06346c68]
- 0x7fbef8086000
@ /home/ubuntu/glibc/local/lib/libstdc++.so.6:(_Znwm+0x25)[0x7fbf06348c1d]
+ 0x7fbef8086000 0x38
_Znwm is the mangled name for "new" and _ZdlPv for "delete", so what
it is basically
saying is that the address 0x7fbef8086000 was allocated by "new" but
not freed and then its saying that
0x7fbef8086000 is trying to be freed by "delete", but it was never
allocated in the first place !!! WTF !!!
Cheers,
Vinu