A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Sun Mar 1 10:56: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: 8208k -> 8207k
    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: 8452k -> 8451k
    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: 8240k -> 8239k
    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: 8452k -> 8451k
    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: 8456k -> 8455k
    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: 31988k -> 31987k
    Peak memory use before GGC: 18016k
    Peak memory use after GGC: 17807k
    Maximum of released memory in single GGC run: 1831k
    Garbage: 38929k
    Leak: 5798k
    Overhead: 5547k
    GGC runs: 338
    Pre-IPA-Garbage: 12216k
    Pre-IPA-Leak: 19355k
    Pre-IPA-Overhead: 2559k
    Post-IPA-Garbage: 12216k
    Post-IPA-Leak: 19355k
    Post-IPA-Overhead: 2559k

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 34004k -> 34007k
    Peak memory use before GGC: 19881k -> 19886k
    Peak memory use after GGC: 19662k -> 19663k
    Maximum of released memory in single GGC run: 1841k
    Garbage: 39141k -> 39141k
    Leak: 9088k -> 9087k
    Overhead: 6366k -> 6365k
    GGC runs: 320
    Pre-IPA-Garbage: 12234k
    Pre-IPA-Leak: 21628k
    Pre-IPA-Overhead: 3049k
    Post-IPA-Garbage: 12234k
    Post-IPA-Leak: 21628k
    Post-IPA-Overhead: 3049k

comparing combine.c compilation at -O1 level:
    Overall memory needed: 30692k -> 30603k
    Peak memory use before GGC: 15684k
    Peak memory use after GGC: 15511k
    Maximum of released memory in single GGC run: 1340k
    Garbage: 46457k
    Leak: 5778k
    Overhead: 6146k
    GGC runs: 403
    Pre-IPA-Garbage: 13040k
    Pre-IPA-Leak: 16850k
    Pre-IPA-Overhead: 2472k
    Post-IPA-Garbage: 13040k
    Post-IPA-Leak: 16850k
    Post-IPA-Overhead: 2472k

comparing combine.c compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 5808k to 5816k, overall 0.14%
    Overall memory needed: 31640k -> 31487k
    Peak memory use before GGC: 15830k
    Peak memory use after GGC: 15670k
    Maximum of released memory in single GGC run: 1351k
    Garbage: 60427k -> 60421k
    Leak: 5808k -> 5816k
    Overhead: 8201k -> 8200k
    GGC runs: 467 -> 466
    Pre-IPA-Garbage: 13182k
    Pre-IPA-Leak: 16931k
    Pre-IPA-Overhead: 2492k
    Post-IPA-Garbage: 13182k
    Post-IPA-Leak: 16931k
    Post-IPA-Overhead: 2492k

comparing combine.c compilation at -O3 level:
    Overall memory needed: 32140k -> 32391k
    Peak memory use before GGC: 15984k
    Peak memory use after GGC: 15749k
    Maximum of released memory in single GGC run: 1637k
    Garbage: 73274k
    Leak: 7176k
    Overhead: 9706k
    GGC runs: 497
    Pre-IPA-Garbage: 13182k
    Pre-IPA-Leak: 16931k
    Pre-IPA-Overhead: 2492k
    Post-IPA-Garbage: 13182k
    Post-IPA-Leak: 16931k
    Post-IPA-Overhead: 2492k

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

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 156584k -> 156583k
    Peak memory use before GGC: 66125k -> 66128k
    Peak memory use after GGC: 55057k -> 55061k
    Maximum of released memory in single GGC run: 26838k
    Garbage: 128697k -> 128697k
    Leak: 10011k -> 10011k
    Overhead: 17320k -> 17319k
    GGC runs: 257
    Pre-IPA-Garbage: 36911k
    Pre-IPA-Leak: 56893k
    Pre-IPA-Overhead: 8558k
    Post-IPA-Garbage: 36911k
    Post-IPA-Leak: 56893k
    Post-IPA-Overhead: 8558k

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 133308k -> 133307k
    Peak memory use before GGC: 49848k
    Peak memory use after GGC: 43292k
    Maximum of released memory in single GGC run: 23087k
    Garbage: 178950k
    Leak: 7736k
    Overhead: 24925k
    GGC runs: 299
    Pre-IPA-Garbage: 42194k
    Pre-IPA-Leak: 42950k
    Pre-IPA-Overhead: 7642k
    Post-IPA-Garbage: 42194k
    Post-IPA-Leak: 42950k
    Post-IPA-Overhead: 7642k

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

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

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 149147k -> 149128k
    Peak memory use before GGC: 81831k
    Peak memory use after GGC: 81019k
    Maximum of released memory in single GGC run: 14704k
    Garbage: 200356k
    Leak: 51679k
    Overhead: 27607k
    GGC runs: 411
    Pre-IPA-Garbage: 109766k
    Pre-IPA-Leak: 87211k
    Pre-IPA-Overhead: 14734k
    Post-IPA-Garbage: 109766k
    Post-IPA-Leak: 87211k
    Post-IPA-Overhead: 14734k

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 167151k -> 167156k
    Peak memory use before GGC: 95411k
    Peak memory use after GGC: 94466k
    Maximum of released memory in single GGC run: 14896k
    Garbage: 205376k -> 205376k
    Leak: 78534k -> 78533k
    Overhead: 34294k -> 34293k
    GGC runs: 386
    Pre-IPA-Garbage: 110131k
    Pre-IPA-Leak: 103730k
    Pre-IPA-Overhead: 18238k
    Post-IPA-Garbage: 110131k
    Post-IPA-Leak: 103730k
    Post-IPA-Overhead: 18238k

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 105420k -> 104923k
    Peak memory use before GGC: 79653k
    Peak memory use after GGC: 78844k
    Maximum of released memory in single GGC run: 14399k
    Garbage: 266884k -> 266883k
    Leak: 48147k
    Overhead: 31144k -> 31144k
    GGC runs: 491
    Pre-IPA-Garbage: 153238k
    Pre-IPA-Leak: 83485k -> 83485k
    Pre-IPA-Overhead: 19276k -> 19276k
    Post-IPA-Garbage: 153238k
    Post-IPA-Leak: 83485k -> 83485k
    Post-IPA-Overhead: 19276k -> 19276k

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 105960k -> 105991k
    Peak memory use before GGC: 80042k -> 80029k
    Peak memory use after GGC: 79244k -> 79231k
    Maximum of released memory in single GGC run: 14401k
    Garbage: 320755k -> 320859k
    Leak: 48172k -> 48180k
    Overhead: 37693k -> 37699k
    GGC runs: 563
    Pre-IPA-Garbage: 157072k
    Pre-IPA-Leak: 83224k -> 83218k
    Pre-IPA-Overhead: 19713k -> 19713k
    Post-IPA-Garbage: 157072k
    Post-IPA-Leak: 83224k -> 83218k
    Post-IPA-Overhead: 19713k -> 19713k

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 107136k -> 107159k
    Peak memory use before GGC: 80532k -> 80517k
    Peak memory use after GGC: 79725k -> 79711k
    Maximum of released memory in single GGC run: 14401k
    Garbage: 352150k -> 352113k
    Leak: 48192k -> 48168k
    Overhead: 41008k -> 40985k
    GGC runs: 592 -> 591
    Pre-IPA-Garbage: 157134k
    Pre-IPA-Leak: 83740k -> 83733k
    Pre-IPA-Overhead: 19756k -> 19756k
    Post-IPA-Garbage: 157134k
    Post-IPA-Leak: 83740k -> 83733k
    Post-IPA-Overhead: 19756k -> 19756k

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: 363219k -> 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: 25915k
    GGC runs: 93
    Pre-IPA-Garbage: 12171k
    Pre-IPA-Leak: 20438k
    Pre-IPA-Overhead: 2295k
    Post-IPA-Garbage: 12171k
    Post-IPA-Leak: 20438k
    Post-IPA-Overhead: 2295k

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 226372k -> 226375k
    Peak memory use before GGC: 72350k
    Peak memory use after GGC: 66141k
    Maximum of released memory in single GGC run: 32063k
    Garbage: 214870k
    Leak: 7613k
    Overhead: 30709k
    GGC runs: 95
    Pre-IPA-Garbage: 45532k
    Pre-IPA-Leak: 63003k
    Pre-IPA-Overhead: 8797k
    Post-IPA-Garbage: 45532k
    Post-IPA-Leak: 63003k
    Post-IPA-Overhead: 8797k

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 493240k -> 492639k
    Peak memory use before GGC: 72351k
    Peak memory use after GGC: 66142k
    Maximum of released memory in single GGC run: 33399k
    Garbage: 256471k
    Leak: 7614k
    Overhead: 38779k
    GGC runs: 105
    Pre-IPA-Garbage: 101938k
    Pre-IPA-Leak: 75899k
    Pre-IPA-Overhead: 14919k
    Post-IPA-Garbage: 101938k
    Post-IPA-Leak: 75899k
    Post-IPA-Overhead: 14919k

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1026556k -> 1026899k
    Peak memory use before GGC: 139344k
    Peak memory use after GGC: 129173k
    Maximum of released memory in single GGC run: 62793k
    Garbage: 354550k
    Leak: 9097k
    Overhead: 45960k
    GGC runs: 100
    Pre-IPA-Garbage: 101938k
    Pre-IPA-Leak: 75899k
    Pre-IPA-Overhead: 14919k
    Post-IPA-Garbage: 101938k
    Post-IPA-Leak: 75899k
    Post-IPA-Overhead: 14919k

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2009-02-27 23:05:20.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2009-03-01 07:44:54.000000000 +0000
@@ -1,3 +1,39 @@
+2009-02-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR target/39327
+	* config/i386/sse.md (avx_addsubv8sf3): Correct item bits.
+	(avx_addsubv4df3): Likewise.
+	(*avx_addsubv4sf3): Likewise.
+	(sse3_addsubv4sf3): Likewise.
+	(*avx_addsubv2df3): Likewise.
+	(sse3_addsubv2df3): Likewise.
+	(avx_unpckhps256): Correct item selectors.
+	(avx_unpcklps256): Likewise.
+	(avx_unpckhpd256): Likewise.
+	(avx_unpcklpd256): Likewise.
+
+2009-02-28  Jan Hubicka  <jh@suse.cz>
+
+	* tree-inline.c (expand_call_inline): Avoid duplicate declarations of
+	static vars.
+	(copy_arguments_for_versioning): If var is declared don't declare it.
+	(tree_function_versioning): First setup substitutions and then copy
+	args.
+
+2009-02-27  Jan Hubicka  <jh@suse.cz>
+
+	PR debug/39267
+	* cgraph.h (varpool_output_debug_info): Remove.
+	* cgraphunit.c (varpool_output_debug_info): Remove.
+	* dwarf2out.c (deferred_locations_struct): New struct
+	(deferred_locations): New type.
+	(deferred_locations_list): New static var.
+	(deffer_location): New function.
+	(gen_variable_die): Use it.
+	(decls_for_scope): Output info on local static vars.
+	(dwarf2out_finish): Process deferred locations.
+	* varpool.c (varpool_output_debug_info): Remove.
+
 2009-02-27  Jan Hubicka  <jh@suse.cz>
 
 	PR debug/39267


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