A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Wed Jun 27 13:28:00 GMT 2007


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: 8332k
    Peak memory use before GGC: 3323k
    Peak memory use after GGC: 2988k
    Maximum of released memory in single GGC run: 335k
    Garbage: 490k
    Leak: 3720k
    Overhead: 874k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8348k
    Peak memory use before GGC: 3351k
    Peak memory use after GGC: 3015k
    Maximum of released memory in single GGC run: 336k
    Garbage: 492k
    Leak: 3752k
    Overhead: 878k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 8384k -> 8388k
    Peak memory use before GGC: 3323k
    Peak memory use after GGC: 2988k
    Maximum of released memory in single GGC run: 335k
    Garbage: 495k
    Leak: 3722k
    Overhead: 874k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 8396k -> 8400k
    Peak memory use before GGC: 3323k
    Peak memory use after GGC: 2988k
    Maximum of released memory in single GGC run: 335k
    Garbage: 498k
    Leak: 3722k
    Overhead: 875k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 8396k -> 8400k
    Peak memory use before GGC: 3323k
    Peak memory use after GGC: 2988k
    Maximum of released memory in single GGC run: 335k
    Garbage: 498k
    Leak: 3722k
    Overhead: 875k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23396k -> 23400k
    Peak memory use before GGC: 9967k
    Peak memory use after GGC: 9189k
    Maximum of released memory in single GGC run: 1907k
    Garbage: 38260k
    Leak: 8337k
    Overhead: 5338k
    GGC runs: 243

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 25300k
    Peak memory use before GGC: 11631k
    Peak memory use after GGC: 10975k
    Maximum of released memory in single GGC run: 1880k
    Garbage: 38640k
    Leak: 11230k
    Overhead: 6044k
    GGC runs: 241

comparing combine.c compilation at -O1 level:
    Overall memory needed: 37104k
    Peak memory use before GGC: 18608k
    Peak memory use after GGC: 18407k
    Maximum of released memory in single GGC run: 1379k
    Garbage: 51724k
    Leak: 8393k
    Overhead: 6447k
    GGC runs: 317

comparing combine.c compilation at -O2 level:
    Overall memory needed: 39024k -> 39028k
    Peak memory use before GGC: 18649k
    Peak memory use after GGC: 18464k
    Maximum of released memory in single GGC run: 1356k
    Garbage: 68457k -> 68465k
    Leak: 8519k
    Overhead: 8577k -> 8578k
    GGC runs: 373 -> 374

comparing combine.c compilation at -O3 level:
    Overall memory needed: 44484k
    Peak memory use before GGC: 18802k
    Peak memory use after GGC: 18599k
    Maximum of released memory in single GGC run: 3718k
    Garbage: 93707k -> 93709k
    Leak: 8631k
    Overhead: 11866k -> 11866k
    GGC runs: 404

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 143060k -> 143064k
    Peak memory use before GGC: 60776k
    Peak memory use after GGC: 33782k
    Maximum of released memory in single GGC run: 34624k
    Garbage: 131970k
    Leak: 11182k
    Overhead: 14735k
    GGC runs: 186

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 144336k -> 144332k
    Peak memory use before GGC: 61938k
    Peak memory use after GGC: 34943k
    Maximum of released memory in single GGC run: 34625k
    Garbage: 132202k
    Leak: 12890k
    Overhead: 15133k
    GGC runs: 191

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 153540k -> 153532k
    Peak memory use before GGC: 59006k
    Peak memory use after GGC: 54779k
    Maximum of released memory in single GGC run: 23623k
    Garbage: 215879k
    Leak: 11068k
    Overhead: 25091k
    GGC runs: 217

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 194232k
    Peak memory use before GGC: 58885k
    Peak memory use after GGC: 54870k
    Maximum of released memory in single GGC run: 21314k
    Garbage: 248433k -> 248435k
    Leak: 11057k
    Overhead: 30441k -> 30441k
    GGC runs: 240

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 198008k
    Peak memory use before GGC: 70104k
    Peak memory use after GGC: 65673k
    Maximum of released memory in single GGC run: 22921k
    Garbage: 277483k -> 277485k
    Leak: 11068k
    Overhead: 32160k -> 32160k
    GGC runs: 242

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 154240k -> 154191k
    Peak memory use before GGC: 89734k
    Peak memory use after GGC: 88846k
    Maximum of released memory in single GGC run: 17863k
    Garbage: 208375k
    Leak: 52513k
    Overhead: 24545k
    GGC runs: 399

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 174648k -> 174643k
    Peak memory use before GGC: 102488k
    Peak memory use after GGC: 101473k
    Maximum of released memory in single GGC run: 18365k
    Garbage: 214040k
    Leak: 75823k
    Overhead: 30441k
    GGC runs: 374

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 150498k -> 150502k
    Peak memory use before GGC: 101301k
    Peak memory use after GGC: 100292k
    Maximum of released memory in single GGC run: 17436k
    Garbage: 335902k
    Leak: 53598k
    Overhead: 31341k
    GGC runs: 510

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 158914k -> 158918k
    Peak memory use before GGC: 101651k
    Peak memory use after GGC: 100642k
    Maximum of released memory in single GGC run: 17436k
    Garbage: 383844k -> 383916k
    Leak: 54307k
    Overhead: 36971k -> 36986k
    GGC runs: 562

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 160574k
    Peak memory use before GGC: 103621k -> 103622k
    Peak memory use after GGC: 102590k
    Maximum of released memory in single GGC run: 17798k
    Garbage: 415730k -> 415829k
    Leak: 54574k
    Overhead: 39472k -> 39491k
    GGC runs: 583

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 387574k -> 387578k
    Peak memory use before GGC: 103386k
    Peak memory use after GGC: 59040k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179453k
    Leak: 8877k
    Overhead: 31379k
    GGC runs: 64

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 388378k -> 388382k
    Peak memory use before GGC: 104033k
    Peak memory use after GGC: 59686k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179509k
    Leak: 10645k
    Overhead: 31875k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 310896k -> 311696k
    Peak memory use before GGC: 84352k
    Peak memory use after GGC: 75887k
    Maximum of released memory in single GGC run: 39403k
    Garbage: 232481k
    Leak: 22312k
    Overhead: 32107k
    GGC runs: 71

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
  Amount of produced GGC garbage increased from 240335k to 240662k, overall 0.14%
    Overall memory needed: 319792k -> 320000k
    Peak memory use before GGC: 80873k
    Peak memory use after GGC: 75887k
    Maximum of released memory in single GGC run: 33014k
    Garbage: 240335k -> 240662k
    Leak: 22392k
    Overhead: 34341k -> 34406k
    GGC runs: 81 -> 83

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1032816k -> 1032496k
    Peak memory use before GGC: 184627k
    Peak memory use after GGC: 172143k
    Maximum of released memory in single GGC run: 80733k -> 80995k
    Garbage: 348761k -> 349089k
    Leak: 47770k
    Overhead: 45186k -> 45251k
    GGC runs: 66

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-06-26 19:18:25.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-06-27 11:24:04.000000000 +0000
@@ -1,3 +1,23 @@
+2007-06-26  Jan Hubicka  <jh@suse.cz>
+
+	* fwprop.c (try_fwprop_subst): Use validate_unshare_change.
+	* postreload.c (reload_cse_simplify_set): Instead of copying the rtx
+	early use validate_unshare_change.
+	(reload_combine): Likewise.
+	* recog.c (change_t): New field unshare.
+	(validate_change_1): Rename from validate_change; add argument unshare.
+	(validate_change): Turn into wrapper of validate_change_1; update
+	prototype for bools.
+	(validate_unshare_change): New.
+	(confirm_change_group): Unshare changes if asked for; avoid unnecesary
+	calls of df_insn_rescan.
+	* recog.h (validate_change): Replace ints by bools.
+	(validate_unshare_change): Declare.
+
+2007-06-26  Kenneth Zadeck <zadeck@naturalbridge.com>
+
+        * tree.def (VEC_WIDEN_MULT_LO_EXPR): Corrected string name.
+	
 2007-06-26  Steve Ellcey  <sje@cup.hp.com>
 
 	* builtins.c (expand_builtin_next_arg): Change Pmode to ptr_mode.


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