I see the *exact* same problem. Large C++ codes, and gcc spending most of the
CPU time in kernel.
> The reason for this is big vm map:
>
> cat /proc/15677/maps |wc -l
> 2238
Exactly what I see too. 200 MB of memory allocated in 4K maps...
There is an easy fix: In libiberty in GCC we could change xmalloc()
to do real malloc instead of calloc(). I think that would fix it.
Or glibc could be fixed to make calloc() behave more reasonably
when it's called with tons and tons of 4K allocations.
Or the kernel could be fixed to merge maps.
...
> .....
> 15677 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40019000
hear hear !
...
>
> OK, the numbers are here. g++ is 2.96 from RedHat 7.0.
> Please, CC me, as I'm not on the list.
gcc 2.96 here too.
Should we take this up with the glibc or gcc folks, or should
someone fix the kernel ?
This *is* a very significant performance problem for a standard tool.
-- ................................................................ : jakob@unthought.net : And I see the elder races, : :.........................: putrid forms of man : : Jakob Østergaard : See him rise and claim the earth, : : OZ9ABN : his downfall is at hand. : :.........................:............{Konkhra}...............: - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/