A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Sun Mar 8 06:24:00 GMT 2009


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 empty function compilation at -O0 level:
    Overall memory needed: 8209k
    Peak memory use before GGC: 1289k
    Peak memory use after GGC: 1216k
    Maximum of released memory in single GGC run: 138k
    Garbage: 217k
    Leak: 1219k
    Overhead: 136k
    GGC runs: 3
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1222k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1222k
    Post-IPA-Overhead: 135k

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8453k
    Peak memory use before GGC: 1317k
    Peak memory use after GGC: 1243k
    Maximum of released memory in single GGC run: 133k
    Garbage: 218k
    Leak: 1252k
    Overhead: 141k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1222k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1222k
    Post-IPA-Overhead: 135k

comparing empty function compilation at -O1 level:
    Overall memory needed: 8237k
    Peak memory use before GGC: 1289k
    Peak memory use after GGC: 1216k
    Maximum of released memory in single GGC run: 133k
    Garbage: 219k
    Leak: 1219k
    Overhead: 137k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1222k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1222k
    Post-IPA-Overhead: 135k

comparing empty function compilation at -O2 level:
    Overall memory needed: 8453k
    Peak memory use before GGC: 1289k
    Peak memory use after GGC: 1216k
    Maximum of released memory in single GGC run: 136k
    Garbage: 225k
    Leak: 1220k
    Overhead: 138k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1223k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1223k
    Post-IPA-Overhead: 135k

comparing empty function compilation at -O3 level:
    Overall memory needed: 8453k
    Peak memory use before GGC: 1289k
    Peak memory use after GGC: 1216k
    Maximum of released memory in single GGC run: 136k
    Garbage: 225k
    Leak: 1220k
    Overhead: 138k
    GGC runs: 4
    Pre-IPA-Garbage: 207k
    Pre-IPA-Leak: 1223k
    Pre-IPA-Overhead: 135k
    Post-IPA-Garbage: 207k
    Post-IPA-Leak: 1223k
    Post-IPA-Overhead: 135k

comparing combine.c compilation at -O0 level:
    Overall memory needed: 31989k
    Peak memory use before GGC: 18016k
    Peak memory use after GGC: 17807k
    Maximum of released memory in single GGC run: 1831k
    Garbage: 38927k
    Leak: 5798k
    Overhead: 5545k
    GGC runs: 338
    Pre-IPA-Garbage: 12215k
    Pre-IPA-Leak: 19353k
    Pre-IPA-Overhead: 2557k
    Post-IPA-Garbage: 12215k
    Post-IPA-Leak: 19353k
    Post-IPA-Overhead: 2557k

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 34009k
    Peak memory use before GGC: 19886k
    Peak memory use after GGC: 19663k
    Maximum of released memory in single GGC run: 1841k
    Garbage: 39138k
    Leak: 9087k
    Overhead: 6363k
    GGC runs: 320
    Pre-IPA-Garbage: 12233k
    Pre-IPA-Leak: 21626k
    Pre-IPA-Overhead: 3047k
    Post-IPA-Garbage: 12233k
    Post-IPA-Leak: 21626k
    Post-IPA-Overhead: 3047k

comparing combine.c compilation at -O1 level:
    Overall memory needed: 30601k
    Peak memory use before GGC: 15684k
    Peak memory use after GGC: 15511k
    Maximum of released memory in single GGC run: 1340k
    Garbage: 46454k
    Leak: 5778k
    Overhead: 6143k
    GGC runs: 403
    Pre-IPA-Garbage: 13039k
    Pre-IPA-Leak: 16848k
    Pre-IPA-Overhead: 2469k
    Post-IPA-Garbage: 13039k
    Post-IPA-Leak: 16848k
    Post-IPA-Overhead: 2469k

comparing combine.c compilation at -O2 level:
    Overall memory needed: 31745k -> 31645k
    Peak memory use before GGC: 15830k
    Peak memory use after GGC: 15670k
    Maximum of released memory in single GGC run: 1351k
    Garbage: 60423k
    Leak: 5808k
    Overhead: 8198k
    GGC runs: 467
    Pre-IPA-Garbage: 13181k
    Pre-IPA-Leak: 16929k
    Pre-IPA-Overhead: 2489k
    Post-IPA-Garbage: 13181k
    Post-IPA-Leak: 16929k
    Post-IPA-Overhead: 2489k

comparing combine.c compilation at -O3 level:
    Overall memory needed: 32233k
    Peak memory use before GGC: 15984k
    Peak memory use after GGC: 15749k
    Maximum of released memory in single GGC run: 1637k
    Garbage: 73270k
    Leak: 7176k
    Overhead: 9702k
    GGC runs: 497
    Pre-IPA-Garbage: 13181k
    Pre-IPA-Leak: 16929k
    Pre-IPA-Overhead: 2489k
    Post-IPA-Garbage: 13181k
    Post-IPA-Leak: 16929k
    Post-IPA-Overhead: 2489k

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 155297k
    Peak memory use before GGC: 64851k
    Peak memory use after GGC: 53783k
    Maximum of released memory in single GGC run: 26838k
    Garbage: 128371k
    Leak: 8360k
    Overhead: 16863k
    GGC runs: 262
    Pre-IPA-Garbage: 36903k
    Pre-IPA-Leak: 55351k
    Pre-IPA-Overhead: 8222k
    Post-IPA-Garbage: 36903k
    Post-IPA-Leak: 55351k
    Post-IPA-Overhead: 8222k

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 156581k
    Peak memory use before GGC: 66128k
    Peak memory use after GGC: 55061k
    Maximum of released memory in single GGC run: 26838k
    Garbage: 128696k
    Leak: 10011k
    Overhead: 17319k
    GGC runs: 257
    Pre-IPA-Garbage: 36911k
    Pre-IPA-Leak: 56892k
    Pre-IPA-Overhead: 8557k
    Post-IPA-Garbage: 36911k
    Post-IPA-Leak: 56892k
    Post-IPA-Overhead: 8557k

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 133309k
    Peak memory use before GGC: 49848k
    Peak memory use after GGC: 43292k
    Maximum of released memory in single GGC run: 23087k
    Garbage: 178949k
    Leak: 7736k
    Overhead: 24924k
    GGC runs: 299
    Pre-IPA-Garbage: 42194k
    Pre-IPA-Leak: 42949k
    Pre-IPA-Overhead: 7641k
    Post-IPA-Garbage: 42194k
    Post-IPA-Leak: 42949k
    Post-IPA-Overhead: 7641k

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 148657k
    Peak memory use before GGC: 49813k
    Peak memory use after GGC: 44951k
    Maximum of released memory in single GGC run: 18102k
    Garbage: 202596k
    Leak: 15399k
    Overhead: 30421k
    GGC runs: 326
    Pre-IPA-Garbage: 42262k
    Pre-IPA-Leak: 42956k
    Pre-IPA-Overhead: 7650k
    Post-IPA-Garbage: 42262k
    Post-IPA-Leak: 42956k
    Post-IPA-Overhead: 7650k

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 164629k
    Peak memory use before GGC: 61633k
    Peak memory use after GGC: 58663k
    Maximum of released memory in single GGC run: 24089k
    Garbage: 240476k
    Leak: 7762k
    Overhead: 33890k
    GGC runs: 338
    Pre-IPA-Garbage: 42262k
    Pre-IPA-Leak: 42956k
    Pre-IPA-Overhead: 7650k
    Post-IPA-Garbage: 42262k
    Post-IPA-Leak: 42956k
    Post-IPA-Overhead: 7650k

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 149156k
    Peak memory use before GGC: 81836k
    Peak memory use after GGC: 81024k -> 81023k
    Maximum of released memory in single GGC run: 14704k -> 14705k
    Garbage: 200273k -> 200213k
    Leak: 51651k -> 51651k
    Overhead: 27488k -> 27478k
    GGC runs: 411
    Pre-IPA-Garbage: 109714k -> 109676k
    Pre-IPA-Leak: 87152k -> 87149k
    Pre-IPA-Overhead: 14615k -> 14609k
    Post-IPA-Garbage: 109714k -> 109676k
    Post-IPA-Leak: 87152k -> 87149k
    Post-IPA-Overhead: 14615k -> 14609k

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 167188k -> 167212k
    Peak memory use before GGC: 95416k
    Peak memory use after GGC: 94471k
    Maximum of released memory in single GGC run: 14896k -> 14897k
    Garbage: 205292k -> 205232k
    Leak: 78505k -> 78505k
    Overhead: 34173k -> 34164k
    GGC runs: 384
    Pre-IPA-Garbage: 110079k -> 110041k
    Pre-IPA-Leak: 103671k -> 103668k
    Pre-IPA-Overhead: 18119k -> 18114k
    Post-IPA-Garbage: 110079k -> 110041k
    Post-IPA-Leak: 103671k -> 103668k
    Post-IPA-Overhead: 18119k -> 18114k

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 79658k to 79795k, overall 0.17%
  Peak amount of GGC memory still allocated after garbage collecting increased from 78849k to 79004k, overall 0.20%
    Overall memory needed: 104215k -> 104299k
    Peak memory use before GGC: 79658k -> 79795k
    Peak memory use after GGC: 78849k -> 79004k
    Maximum of released memory in single GGC run: 14399k -> 14368k
    Garbage: 265050k -> 265045k
    Leak: 48118k -> 48118k
    Overhead: 30544k -> 30532k
    GGC runs: 490 -> 491
    Pre-IPA-Garbage: 153147k -> 153114k
    Pre-IPA-Leak: 82611k -> 82623k
    Pre-IPA-Overhead: 18855k -> 18853k
    Post-IPA-Garbage: 153147k -> 153114k
    Post-IPA-Leak: 82611k -> 82623k
    Post-IPA-Overhead: 18855k -> 18853k

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 79748k to 79886k, overall 0.17%
  Peak amount of GGC memory still allocated after garbage collecting increased from 78939k to 79093k, overall 0.20%
  Amount of produced GGC garbage increased from 318692k to 319248k, overall 0.17%
    Overall memory needed: 104715k -> 104719k
    Peak memory use before GGC: 79748k -> 79886k
    Peak memory use after GGC: 78939k -> 79093k
    Maximum of released memory in single GGC run: 14403k -> 14371k
    Garbage: 318692k -> 319248k
    Leak: 48143k -> 48143k
    Overhead: 37054k -> 37087k
    GGC runs: 563 -> 565
    Pre-IPA-Garbage: 156994k -> 156986k
    Pre-IPA-Leak: 81960k -> 81975k
    Pre-IPA-Overhead: 19243k -> 19245k
    Post-IPA-Garbage: 156994k -> 156986k
    Post-IPA-Leak: 81960k -> 81975k
    Post-IPA-Overhead: 19243k -> 19245k

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 79748k to 79886k, overall 0.17%
  Peak amount of GGC memory still allocated after garbage collecting increased from 78939k to 79093k, overall 0.20%
  Amount of produced GGC garbage increased from 350020k to 350786k, overall 0.22%
    Overall memory needed: 105107k -> 105083k
    Peak memory use before GGC: 79748k -> 79886k
    Peak memory use after GGC: 78939k -> 79093k
    Maximum of released memory in single GGC run: 14403k -> 14371k
    Garbage: 350020k -> 350786k
    Leak: 48155k -> 48163k
    Overhead: 40369k -> 40447k
    GGC runs: 592 -> 596
    Pre-IPA-Garbage: 157056k -> 157048k
    Pre-IPA-Leak: 82397k -> 82412k
    Pre-IPA-Overhead: 19278k -> 19280k
    Post-IPA-Garbage: 157056k -> 157048k
    Post-IPA-Leak: 82397k -> 82412k
    Post-IPA-Overhead: 19278k -> 19280k

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 362427k
    Peak memory use before GGC: 78666k
    Peak memory use after GGC: 49600k
    Maximum of released memory in single GGC run: 37952k
    Garbage: 142896k
    Leak: 7236k
    Overhead: 25331k
    GGC runs: 87
    Pre-IPA-Garbage: 12169k
    Pre-IPA-Leak: 20189k
    Pre-IPA-Overhead: 2241k
    Post-IPA-Garbage: 12169k
    Post-IPA-Leak: 20189k
    Post-IPA-Overhead: 2241k

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 363223k
    Peak memory use before GGC: 79363k
    Peak memory use after GGC: 50297k
    Maximum of released memory in single GGC run: 37936k
    Garbage: 142961k
    Leak: 9278k
    Overhead: 25914k
    GGC runs: 93
    Pre-IPA-Garbage: 12171k
    Pre-IPA-Leak: 20437k
    Pre-IPA-Overhead: 2295k
    Post-IPA-Garbage: 12171k
    Post-IPA-Leak: 20437k
    Post-IPA-Overhead: 2295k

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 226369k
    Peak memory use before GGC: 72350k
    Peak memory use after GGC: 66141k
    Maximum of released memory in single GGC run: 32063k
    Garbage: 214749k
    Leak: 7613k
    Overhead: 30605k
    GGC runs: 95
    Pre-IPA-Garbage: 45532k
    Pre-IPA-Leak: 62930k
    Pre-IPA-Overhead: 8724k
    Post-IPA-Garbage: 45532k
    Post-IPA-Leak: 62930k
    Post-IPA-Overhead: 8724k

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 492849k -> 492809k
    Peak memory use before GGC: 72351k
    Peak memory use after GGC: 66142k
    Maximum of released memory in single GGC run: 33399k
    Garbage: 256350k
    Leak: 7614k
    Overhead: 38675k
    GGC runs: 105
    Pre-IPA-Garbage: 102815k
    Pre-IPA-Leak: 71658k
    Pre-IPA-Overhead: 14333k
    Post-IPA-Garbage: 102815k
    Post-IPA-Leak: 71658k
    Post-IPA-Overhead: 14333k

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1021365k -> 1021565k
    Peak memory use before GGC: 135542k
    Peak memory use after GGC: 125371k
    Maximum of released memory in single GGC run: 62793k
    Garbage: 347813k
    Leak: 9097k
    Overhead: 44904k
    GGC runs: 101
    Pre-IPA-Garbage: 102815k
    Pre-IPA-Leak: 71658k
    Pre-IPA-Overhead: 14333k
    Post-IPA-Garbage: 102815k
    Post-IPA-Leak: 71658k
    Post-IPA-Overhead: 14333k

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2009-03-07 10:50:39.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2009-03-08 03:10:44.000000000 +0000
@@ -1,3 +1,11 @@
+2009-03-07  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+	PR middle-end/38028
+	* function.c (assign_parm_setup_stack): Use STACK_SLOT_ALIGNMENT to
+	determine alignment passed to assign_stack_local.
+	(assign_parms_unsplit_complex): Likewise.
+	* except.c (sjlj_build_landing_pads): Likewise.
+
 2009-03-06  Jakub Jelinek  <jakub@redhat.com>
 
 	PR middle-end/39360
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2009-03-07 10:50:38.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2009-03-08 03:10:44.000000000 +0000
@@ -1,3 +1,9 @@
+2009-03-07  Jason Merrill  <jason@redhat.com>
+
+	PR c++/39367
+	* init.c (build_new_1): Don't use a VLA type.
+	(build_vec_init): Handle getting a pointer for BASE.
+
 2009-03-06  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR c++/37520


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.



More information about the Gcc-regression mailing list