A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Fri Jun 24 03:20:00 GMT 2005


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: 24808k
    Peak memory use before GGC: 9675k
    Peak memory use after GGC: 9022k
    Maximum of released memory in single GGC run: 2796k
    Garbage: 42113k
    Leak: 6700k
    Overhead: 5769k
    GGC runs: 338

comparing combine.c compilation at -O1 level:
    Overall memory needed: 16796k
    Peak memory use before GGC: 9132k
    Peak memory use after GGC: 8614k
    Maximum of released memory in single GGC run: 2139k
    Garbage: 64256k
    Leak: 7143k
    Overhead: 7994k
    GGC runs: 530

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 86855k to 87026k, overall 0.20%
    Overall memory needed: 24216k
    Peak memory use before GGC: 17661k -> 17660k
    Peak memory use after GGC: 17481k
    Maximum of released memory in single GGC run: 2512k -> 2513k
    Garbage: 86855k -> 87026k
    Leak: 7168k -> 7172k
    Overhead: 11008k -> 11009k
    GGC runs: 493 -> 492

comparing combine.c compilation at -O3 level:
    Overall memory needed: 24684k -> 24688k
    Peak memory use before GGC: 17673k -> 17658k
    Peak memory use after GGC: 17481k
    Maximum of released memory in single GGC run: 3311k -> 3429k
    Garbage: 115941k -> 115887k
    Leak: 7264k -> 7269k
    Overhead: 14764k -> 14752k
    GGC runs: 540 -> 539

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 82972k
    Peak memory use before GGC: 71243k
    Peak memory use after GGC: 45264k
    Maximum of released memory in single GGC run: 37298k
    Garbage: 150188k
    Leak: 11540k
    Overhead: 18395k
    GGC runs: 269

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 98552k
    Peak memory use before GGC: 72979k
    Peak memory use after GGC: 62386k
    Maximum of released memory in single GGC run: 36555k
    Garbage: 294872k
    Leak: 11640k
    Overhead: 35882k
    GGC runs: 385

comparing insn-attrtab.c compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 116924k to 117207k, overall 0.24%
  Peak amount of GGC memory still allocated after garbage collectin increased from 87333k to 87518k, overall 0.21%
  Amount of produced GGC garbage increased from 390283k to 390851k, overall 0.15%
    Overall memory needed: 155120k -> 155324k
    Peak memory use before GGC: 116924k -> 117207k
    Peak memory use after GGC: 87333k -> 87518k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 390283k -> 390851k
    Leak: 11500k -> 11500k
    Overhead: 47838k -> 47875k
    GGC runs: 309

comparing insn-attrtab.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 116926k to 117209k, overall 0.24%
  Peak amount of GGC memory still allocated after garbage collectin increased from 87335k to 87520k, overall 0.21%
  Amount of produced GGC garbage increased from 391083k to 391649k, overall 0.14%
    Overall memory needed: 155104k -> 155316k
    Peak memory use before GGC: 116926k -> 117209k
    Peak memory use after GGC: 87335k -> 87520k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 391083k -> 391649k
    Leak: 11522k -> 11520k
    Overhead: 47962k -> 47999k
    GGC runs: 313

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 124848k
    Peak memory use before GGC: 100701k
    Peak memory use after GGC: 99703k
    Maximum of released memory in single GGC run: 21535k
    Garbage: 231704k
    Leak: 53177k
    Overhead: 40198k
    GGC runs: 338

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119224k
    Peak memory use before GGC: 110036k
    Peak memory use after GGC: 98627k
    Maximum of released memory in single GGC run: 19967k
    Garbage: 654409k
    Leak: 58228k
    Overhead: 89212k
    GGC runs: 514

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 748416k to 750142k, overall 0.23%
    Overall memory needed: 119224k
    Peak memory use before GGC: 110036k
    Peak memory use after GGC: 98628k
    Maximum of released memory in single GGC run: 19966k
    Garbage: 748416k -> 750142k
    Leak: 59232k -> 59282k
    Overhead: 106805k -> 106901k
    GGC runs: 588 -> 589

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 807271k to 809120k, overall 0.23%
    Overall memory needed: 121532k
    Peak memory use before GGC: 112836k
    Peak memory use after GGC: 99816k
    Maximum of released memory in single GGC run: 21384k
    Garbage: 807271k -> 809120k
    Leak: 60544k -> 60574k
    Overhead: 114453k -> 114633k
    GGC runs: 596 -> 597

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-23 17:05:15.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-24 02:16:01.000000000 +0000
@@ -1,3 +1,10 @@
+2005-06-23  Jeff Law  <law@redhat.com>
+
+	* tree-optimize.c (init_tree_optimization_passes): Move
+	copy prop pass to run just before VRP.
+	* tree-vrp.c (remove_range_assertions): Remove copies created
+	by ASSERT_EXPR removal.
+
 2005-06-23  Kazu Hirata  <kazu@codesourcery.com>
 
 	PR tree-optimization/22117


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