This is the mail archive of the
gcc-regression@gcc.gnu.org
mailing list for the GCC project.
Re: A recent patch increased GCC's memory consumption!
- From: Jan Hubicka <jh at suse dot cz>
- To: gcctest at suse dot de, joseph at codesourcery dot com
- Cc: jh at suse dot cz, gcc-regression at gcc dot gnu dot org
- Date: Sat, 16 Jul 2005 23:50:23 +0200
- Subject: Re: A recent patch increased GCC's memory consumption!
- References: <42D97591.mailNVZ11WM48@suse.de>
Joseph,
any idea why the patch increased memory by up to 18%?
Honza
> Hi,
>
> I am a friendly script caring about memory consumption in GCC. Please
> contact jh@suse.cz if something is going wrong.
>
> Comparing memory consumption on compilation of combine.i, insn-attrtab.i,
> and generate-3.4.ii I got:
>
>
> comparing combine.c compilation at -O0 level:
> Overall memory needed: 24733k -> 24745k
> Peak memory use before GGC: 9591k -> 9582k
> Peak memory use after GGC: 8938k -> 8930k
> Maximum of released memory in single GGC run: 2754k
> Garbage: 41378k -> 41308k
> Leak: 6709k -> 6696k
> Overhead: 5842k -> 5810k
> GGC runs: 320 -> 321
>
> comparing combine.c compilation at -O1 level:
> Overall memory allocated via mmap and sbrk increased from 23916k to 26808k, overall 12.09%
> Amount of memory still referenced at the end of compilation increased from 7170k to 7186k, overall 0.22%
> Overall memory needed: 23916k -> 26808k
> Peak memory use before GGC: 17374k -> 17359k
> Peak memory use after GGC: 17181k -> 17170k
> Maximum of released memory in single GGC run: 2421k
> Garbage: 66461k -> 66319k
> Leak: 7170k -> 7186k
> Overhead: 7502k -> 7709k
> GGC runs: 412 -> 415
>
> comparing combine.c compilation at -O2 level:
> Overall memory allocated via mmap and sbrk increased from 23932k to 26808k, overall 12.02%
> Amount of memory still referenced at the end of compilation increased from 7410k to 7426k, overall 0.21%
> Overall memory needed: 23932k -> 26808k
> Peak memory use before GGC: 17380k -> 17360k
> Peak memory use after GGC: 17181k -> 17170k
> Maximum of released memory in single GGC run: 2504k -> 2503k
> Garbage: 84832k -> 84713k
> Leak: 7410k -> 7426k
> Overhead: 10034k -> 10258k
> GGC runs: 486 -> 483
>
> comparing combine.c compilation at -O3 level:
> Overall memory allocated via mmap and sbrk increased from 24416k to 29020k, overall 18.86%
> Peak amount of GGC memory allocated before garbage collecting increased from 17657k to 20366k, overall 15.34%
> Amount of produced GGC garbage increased from 115840k to 133347k, overall 15.11%
> Amount of memory still referenced at the end of compilation increased from 7483k to 8017k, overall 7.14%
> Overall memory needed: 24416k -> 29020k
> Peak memory use before GGC: 17657k -> 20366k
> Peak memory use after GGC: 17261k -> 17170k
> Maximum of released memory in single GGC run: 3340k -> 5821k
> Garbage: 115840k -> 133347k
> Leak: 7483k -> 8017k
> Overhead: 13199k -> 15967k
> GGC runs: 537 -> 538
>
> comparing insn-attrtab.c compilation at -O0 level:
> Amount of produced GGC garbage increased from 149716k to 149911k, overall 0.13%
> Overall memory needed: 81648k -> 81640k
> Peak memory use before GGC: 70268k -> 70259k
> Peak memory use after GGC: 45007k -> 44999k
> Maximum of released memory in single GGC run: 37046k
> Garbage: 149716k -> 149911k
> Leak: 11585k -> 11332k
> Overhead: 19128k -> 19105k
> GGC runs: 252 -> 254
>
> comparing insn-attrtab.c compilation at -O1 level:
> Overall memory needed: 115692k -> 114504k
> Peak memory use before GGC: 98465k -> 96264k
> Peak memory use after GGC: 87786k -> 85585k
> Maximum of released memory in single GGC run: 32776k -> 32777k
> Garbage: 295571k -> 295366k
> Leak: 11547k -> 11556k
> Overhead: 35277k -> 35957k
> GGC runs: 284 -> 251
>
> comparing insn-attrtab.c compilation at -O2 level:
> Overall memory needed: 124848k -> 125220k
> Peak memory use before GGC: 117531k -> 115314k
> Peak memory use after GGC: 87770k -> 85553k
> Maximum of released memory in single GGC run: 32461k
> Garbage: 382129k -> 381539k
> Leak: 11662k -> 11670k
> Overhead: 47146k -> 47771k
> GGC runs: 320 -> 279
>
> comparing insn-attrtab.c compilation at -O3 level:
> Amount of memory still referenced at the end of compilation increased from 11678k to 11693k, overall 0.13%
> Overall memory needed: 124852k -> 125236k
> Peak memory use before GGC: 117532k -> 115335k
> Peak memory use after GGC: 87771k -> 85574k
> Maximum of released memory in single GGC run: 32461k -> 32788k
> Garbage: 382660k -> 382215k
> Leak: 11678k -> 11693k
> Overhead: 47295k -> 47932k
> GGC runs: 324 -> 282
>
> comparing Gerald's testcase PR8361 compilation at -O0 level:
> Overall memory needed: 119108k -> 118632k
> Peak memory use before GGC: 95788k -> 95340k
> Peak memory use after GGC: 94840k -> 94393k
> Maximum of released memory in single GGC run: 20762k -> 20159k
> Garbage: 224401k -> 224311k
> Leak: 49424k -> 49424k
> Overhead: 36944k -> 36947k
> GGC runs: 339 -> 340
>
> comparing Gerald's testcase PR8361 compilation at -O1 level:
> Amount of memory still referenced at the end of compilation increased from 55415k to 55690k, overall 0.50%
> Overall memory needed: 105004k -> 106072k
> Peak memory use before GGC: 94848k -> 94843k
> Peak memory use after GGC: 93906k -> 93892k
> Maximum of released memory in single GGC run: 19825k -> 19796k
> Garbage: 597552k -> 597088k
> Leak: 55415k -> 55690k
> Overhead: 64302k -> 69288k
> GGC runs: 520
>
> comparing Gerald's testcase PR8361 compilation at -O2 level:
> Amount of memory still referenced at the end of compilation increased from 56310k to 56627k, overall 0.56%
> Overall memory needed: 105140k -> 106064k
> Peak memory use before GGC: 94848k -> 94843k
> Peak memory use after GGC: 93906k -> 93893k
> Maximum of released memory in single GGC run: 19825k -> 19796k
> Garbage: 679610k -> 679803k
> Leak: 56310k -> 56627k
> Overhead: 75396k -> 80498k
> GGC runs: 592 -> 584
>
> comparing Gerald's testcase PR8361 compilation at -O3 level:
> Amount of produced GGC garbage increased from 722393k to 726345k, overall 0.55%
> Overall memory needed: 106840k -> 108464k
> Peak memory use before GGC: 95930k -> 95603k
> Peak memory use after GGC: 94979k -> 94656k
> Maximum of released memory in single GGC run: 19927k -> 19694k
> Garbage: 722393k -> 726345k
> Leak: 56821k -> 56846k
> Overhead: 78531k -> 84354k
> GGC runs: 603 -> 592
>
> Head of the ChangeLog is:
>
> --- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2005-07-16 15:24:34.000000000 +0000
> +++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2005-07-16 19:56:33.000000000 +0000
> @@ -1,3 +1,15 @@
> +2005-07-16 Eric Botcazou <ebotcazou@libertysurf.fr>
> +
> + * doc/install.texi (*-*-solaris2*): Document recommended version
> + of GNU binutils and mention GNU linker problem on Solaris 10.
> +
> +2005-07-16 Joseph S. Myers <joseph@codesourcery.com>
> +
> + PR c/22421
> + * c-decl.c (c_build_bitfield_integer_type): New function.
> + (finish_struct): Call it.
> + * c-pretty-print.c (pp_c_type_specifier): Handle bit-field types.
> +
> 2005-07-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
>
> * c-typeck.c (digest_init): Call 'convert_for_assignment'
>
>
> The results can be reproduced by building a compiler with
>
> --enable-gather-detailed-mem-stats targetting x86-64
>
> and compiling preprocessed combine.c or testcase from PR8632 with:
>
> -fmem-report --param=ggc-min-heapsize=1024 --param=ggc-min-expand=1 -Ox -Q
>
> The memory consumption summary appears in the dump after detailed listing
> of the places they are allocated in. Peak memory consumption is actually
> computed by looking for maximal value in {GC XXXX -> YYYY} report.
>
> Your testing script.