A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Fri Jun 24 07:49: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 allocated via mmap and sbrk increased from 16796k to 24204k, overall 44.11%
  Peak amount of GGC memory allocated before garbage collecting increased from 9132k to 17663k, overall 93.42%
  Peak amount of GGC memory still allocated after garbage collectin increased from 8614k to 17481k, overall 102.94%
  Amount of produced GGC garbage increased from 64256k to 67483k, overall 5.02%
    Overall memory needed: 16796k -> 24204k
    Peak memory use before GGC: 9132k -> 17663k
    Peak memory use after GGC: 8614k -> 17481k
    Maximum of released memory in single GGC run: 2139k -> 2345k
    Garbage: 64256k -> 67483k
    Leak: 7143k -> 6993k
    Overhead: 7994k -> 8284k
    GGC runs: 530 -> 420

comparing combine.c compilation at -O2 level:
    Overall memory needed: 24216k
    Peak memory use before GGC: 17660k
    Peak memory use after GGC: 17481k
    Maximum of released memory in single GGC run: 2513k
    Garbage: 87026k
    Leak: 7172k
    Overhead: 11009k
    GGC runs: 492

comparing combine.c compilation at -O3 level:
    Overall memory needed: 24688k
    Peak memory use before GGC: 17658k
    Peak memory use after GGC: 17481k
    Maximum of released memory in single GGC run: 3429k
    Garbage: 115887k
    Leak: 7269k
    Overhead: 14752k
    GGC runs: 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 allocated via mmap and sbrk increased from 98552k to 115836k, overall 17.54%
  Peak amount of GGC memory allocated before garbage collecting increased from 72979k to 98123k, overall 34.45%
  Peak amount of GGC memory still allocated after garbage collectin increased from 62386k to 87530k, overall 40.30%
    Overall memory needed: 98552k -> 115836k
    Peak memory use before GGC: 72979k -> 98123k
    Peak memory use after GGC: 62386k -> 87530k
    Maximum of released memory in single GGC run: 36555k -> 33045k
    Garbage: 294872k -> 294872k
    Leak: 11640k -> 11420k
    Overhead: 35882k -> 35908k
    GGC runs: 385 -> 275

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 155324k -> 155320k
    Peak memory use before GGC: 117207k
    Peak memory use after GGC: 87518k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 390851k
    Leak: 11500k
    Overhead: 47875k
    GGC runs: 309

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 155316k -> 155312k
    Peak memory use before GGC: 117209k
    Peak memory use after GGC: 87520k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 391649k
    Leak: 11520k
    Overhead: 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:
    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: 750142k
    Leak: 59282k
    Overhead: 106901k
    GGC runs: 589

comparing Gerald's testcase PR8361 compilation at -O3 level:
    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: 809120k
    Leak: 60574k
    Overhead: 114633k
    GGC runs: 597

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-24 02:16:01.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-24 06:44:32.000000000 +0000
@@ -1,3 +1,13 @@
+2005-06-23  Mark Mitchell  <mark@codesourcery.com>
+
+	PR 22000
+	* tree-ssa-operands.c (get_expr_operands): Check the volatility of
+	the FIELD_DECL and set s_ann->has_volatile_ops accordingly.
+
+2005-06-24  Jan Hubicka  <jh@suse.cz>
+
+	* opts.c (decode_options): Enable unit-at-a-time by default at -O1.
+
 2005-06-23  Jeff Law  <law@redhat.com>
 
 	* tree-optimize.c (init_tree_optimization_passes): Move


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