A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Sat Jun 25 14:09: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: 24824k
    Peak memory use before GGC: 9673k
    Peak memory use after GGC: 9021k
    Maximum of released memory in single GGC run: 2794k
    Garbage: 42068k
    Leak: 6683k
    Overhead: 5755k
    GGC runs: 338

comparing combine.c compilation at -O1 level:
    Overall memory needed: 24204k
    Peak memory use before GGC: 17662k
    Peak memory use after GGC: 17481k
    Maximum of released memory in single GGC run: 2345k
    Garbage: 67420k -> 67412k
    Leak: 6994k
    Overhead: 8274k -> 8272k
    GGC runs: 420

comparing combine.c compilation at -O2 level:
    Overall memory needed: 24224k
    Peak memory use before GGC: 17659k
    Peak memory use after GGC: 17481k
    Maximum of released memory in single GGC run: 2512k
    Garbage: 86969k -> 86974k
    Leak: 7171k -> 7173k
    Overhead: 10998k -> 10998k
    GGC runs: 492 -> 493

comparing combine.c compilation at -O3 level:
  Amount of memory still referenced at the end of compilation increased from 7268k to 7284k, overall 0.22%
    Overall memory needed: 24684k
    Peak memory use before GGC: 17658k
    Peak memory use after GGC: 17481k
    Maximum of released memory in single GGC run: 3430k
    Garbage: 115826k -> 115836k
    Leak: 7268k -> 7284k
    Overhead: 14739k -> 14739k
    GGC runs: 539

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 82972k
    Peak memory use before GGC: 71242k
    Peak memory use after GGC: 45264k
    Maximum of released memory in single GGC run: 37298k
    Garbage: 150150k
    Leak: 11539k
    Overhead: 18387k
    GGC runs: 268

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 115828k -> 115964k
    Peak memory use before GGC: 98122k
    Peak memory use after GGC: 87529k
    Maximum of released memory in single GGC run: 33045k
    Garbage: 294835k -> 294829k
    Leak: 11419k
    Overhead: 35900k -> 35900k
    GGC runs: 275

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 155300k -> 155296k
    Peak memory use before GGC: 117206k
    Peak memory use after GGC: 87517k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 390815k -> 390815k
    Leak: 11499k
    Overhead: 47868k
    GGC runs: 309

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 155304k -> 155308k
    Peak memory use before GGC: 117208k
    Peak memory use after GGC: 87519k
    Maximum of released memory in single GGC run: 33167k
    Garbage: 391614k -> 391614k
    Leak: 11519k
    Overhead: 47992k
    GGC runs: 313

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 124848k
    Peak memory use before GGC: 100700k
    Peak memory use after GGC: 99703k
    Maximum of released memory in single GGC run: 21552k
    Garbage: 229046k
    Leak: 53178k
    Overhead: 39697k
    GGC runs: 334

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: 653910k -> 653909k
    Leak: 58240k
    Overhead: 89057k -> 89057k
    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: 749718k -> 749657k
    Leak: 59261k -> 59278k
    Overhead: 106759k -> 106753k
    GGC runs: 588

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: 808673k -> 808681k
    Leak: 60586k -> 60586k
    Overhead: 114490k -> 114490k
    GGC runs: 597

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-25 08:33:19.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-25 13:03:42.000000000 +0000
@@ -1,3 +1,22 @@
+2005-06-25  Jan Hubicka  <jh@suse.cz>
+
+	* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Update profile.
+	* cfg.c (update_bb_profile_for_threading): Fix rescaling.
+
+	* passes.c (rest_of_handle_branch_prob): Do not rebuild profiling info
+	when not neecesary
+	(rest_of_compilation): Fix conditional on branch prob pass.
+	* predict.c (tree_estimate_probability): Enable strip_builtin_expect
+	when not loop optimizing.
+
+2005-06-25  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* config/bfin/bfin.md (ror_one, rol_one, ashrdi3, ashldi3, lshrdi3):
+	New patterns.
+	(movbi): Add alternative to set CC to zero.
+	(compare_eq, compare_ne, compare_le, compare_lt, compare_leu,
+	compare_ltu): Now named patterns.
+
 2005-06-25  Kelley Cook  <kcook@gcc.gnu.org>
 
 	* all files: Update FSF address in copyright headers.


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