A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Thu Feb 2 07:51:00 GMT 2006


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: 25328k -> 25324k
    Peak memory use before GGC: 9566k
    Peak memory use after GGC: 8913k
    Maximum of released memory in single GGC run: 2649k
    Garbage: 40060k
    Leak: 6740k
    Overhead: 5738k
    GGC runs: 313

comparing combine.c compilation at -O1 level:
    Overall memory needed: 26892k
    Peak memory use before GGC: 17434k
    Peak memory use after GGC: 17255k
    Maximum of released memory in single GGC run: 2309k
    Garbage: 62568k -> 62588k
    Leak: 6881k
    Overhead: 7485k -> 7488k
    GGC runs: 393

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 79972k to 80088k, overall 0.14%
    Overall memory needed: 26892k
    Peak memory use before GGC: 17436k
    Peak memory use after GGC: 17255k
    Maximum of released memory in single GGC run: 2388k
    Garbage: 79972k -> 80088k
    Leak: 6968k -> 6970k
    Overhead: 10012k -> 10033k
    GGC runs: 448 -> 451

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 111230k to 111375k, overall 0.13%
    Overall memory needed: 26892k
    Peak memory use before GGC: 18273k
    Peak memory use after GGC: 17952k
    Maximum of released memory in single GGC run: 3378k
    Garbage: 111230k -> 111375k
    Leak: 7038k
    Overhead: 13694k -> 13722k
    GGC runs: 502

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 80948k
    Peak memory use before GGC: 69508k
    Peak memory use after GGC: 45044k
    Maximum of released memory in single GGC run: 36220k
    Garbage: 146427k
    Leak: 10131k
    Overhead: 19750k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 109560k
    Peak memory use before GGC: 91973k
    Peak memory use after GGC: 81071k
    Maximum of released memory in single GGC run: 32143k
    Garbage: 296337k -> 296462k
    Leak: 10054k
    Overhead: 36077k -> 36102k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 380308k to 381018k, overall 0.19%
    Overall memory needed: 122560k
    Peak memory use before GGC: 109356k
    Peak memory use after GGC: 80974k
    Maximum of released memory in single GGC run: 31578k
    Garbage: 380308k -> 381018k
    Leak: 10156k
    Overhead: 47729k -> 47871k
    GGC runs: 274

comparing insn-attrtab.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 380919k to 381619k, overall 0.18%
    Overall memory needed: 122608k -> 122616k
    Peak memory use before GGC: 109384k -> 109382k
    Peak memory use after GGC: 81001k -> 80999k
    Maximum of released memory in single GGC run: 31908k
    Garbage: 380919k -> 381619k
    Leak: 10160k
    Overhead: 47930k -> 48068k
    GGC runs: 276

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 118252k
    Peak memory use before GGC: 95027k
    Peak memory use after GGC: 94080k
    Maximum of released memory in single GGC run: 20299k
    Garbage: 223448k
    Leak: 49470k
    Overhead: 37085k
    GGC runs: 369

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 108460k
    Peak memory use before GGC: 95143k
    Peak memory use after GGC: 93151k
    Maximum of released memory in single GGC run: 20158k
    Garbage: 564000k -> 563996k
    Leak: 52248k
    Overhead: 63605k -> 63607k
    GGC runs: 532

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 108564k
    Peak memory use before GGC: 95143k
    Peak memory use after GGC: 93152k
    Maximum of released memory in single GGC run: 20158k
    Garbage: 655106k -> 655320k
    Leak: 53066k
    Overhead: 75023k -> 75063k
    GGC runs: 596 -> 597

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 110792k
    Peak memory use before GGC: 96537k
    Peak memory use after GGC: 94579k
    Maximum of released memory in single GGC run: 20582k
    Garbage: 713853k -> 713949k
    Leak: 53955k
    Overhead: 79296k -> 79319k
    GGC runs: 610 -> 609

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-02-01 21:20:51.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-02-02 07:43:34.000000000 +0000
@@ -1,3 +1,31 @@
+2006-02-01  Steve Ellcey  <sje@cup.hp.com>
+
+	PR middle-end/24901
+	* fold-const.c (fold_checksum_tree): Change type of buf.
+
+2006-02-01  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* reload.c (push_secondary_reload): Initialize t_icode.
+
+2006-02-01  Jakub Jelinek  <jakub@redhat.com>
+
+	* config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): For
+	-msoft-float -mlong-double-128 only issue a warning, but don't
+	swich to DFmode long double.
+
+2006-02-01  Hans-Peter Nilsson  <hp@axis.com>
+
+	* cse.c (fold_rtx) <case RTX_COMM_COMPARE, RTX_COMPARE>: When arg1
+	has a constant equivalent, iterate over equivalents for arg0,
+	calling simplify_relational_operation and if there's a result
+	cheaper than X, apply fold_rtx and return the result.
+
+2006-02-01  Jan Hubicka  <jh@suse.cz>
+
+	* opts.c (no_unit_at_a_time_default): New global variable.
+	(decode_options): Use it.
+	* opts.h (no_unit_at_a_time_default): Declare.
+
 2006-02-01  Paul Brook  <paul@codesourcery.com>
 
 	* function.c (assign_parm_setup_reg): Use function argument promotion


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