This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Query regarding anon symbols in the output of pmap command
- From: Ian Lance Taylor <iant at google dot com>
- To: sanshivp at gmail dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 09 Sep 2011 13:54:43 -0700
- Subject: Re: Query regarding anon symbols in the output of pmap command
- References: <9ckon6inc6tkopiyslkgc8o4.1315576485543@email.android.com>
sanshivp@gmail.com writes:
> My application is completely written in C++.
>
> While running my application I run the pmap command on the PID of my application. In the output, there were a lot of memory address ranges which are marked against as anon. With a little bit of googling I found out that these addresses might belong to BSS section of process's memory.
>
> Now my question is :
>
> "Is there any compiler option or any coding style where the number of such anon symbols can be reduced...?"
The compiler will normally create just one anonymous memory range
holding all the BSS variables.
I suspect that you are seeing anonymous memory allocated using mmap.
That is how malloc works on many systems.
Ian