A recent patch decreased GCC's memory consumption.

gcctest@suse.de gcctest@suse.de
Sat Jun 18 02:19: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: 24792k
    Peak memory use before GGC: 9667k
    Peak memory use after GGC: 9015k
    Maximum of released memory in single GGC run: 2793k
    Garbage: 42015k
    Leak: 6690k
    Overhead: 5767k
    GGC runs: 339

comparing combine.c compilation at -O1 level:
    Overall memory needed: 16776k
    Peak memory use before GGC: 9123k
    Peak memory use after GGC: 8606k
    Maximum of released memory in single GGC run: 2140k
    Garbage: 64096k
    Leak: 7133k
    Overhead: 7971k
    GGC runs: 531

comparing combine.c compilation at -O2 level:
    Overall memory needed: 24208k
    Peak memory use before GGC: 17653k
    Peak memory use after GGC: 17473k
    Maximum of released memory in single GGC run: 2510k
    Garbage: 86720k -> 86712k
    Leak: 7158k
    Overhead: 10984k -> 10983k
    GGC runs: 494

comparing combine.c compilation at -O3 level:
    Overall memory needed: 24704k
    Peak memory use before GGC: 17666k
    Peak memory use after GGC: 17473k
    Maximum of released memory in single GGC run: 3427k -> 3309k
    Garbage: 115790k -> 115781k
    Leak: 7270k -> 7254k
    Overhead: 14752k -> 14753k
    GGC runs: 541

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 82964k
    Peak memory use before GGC: 70949k
    Peak memory use after GGC: 45257k
    Maximum of released memory in single GGC run: 37012k
    Garbage: 149563k
    Leak: 11531k
    Overhead: 18393k
    GGC runs: 270

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 98468k
    Peak memory use before GGC: 72971k
    Peak memory use after GGC: 62378k
    Maximum of released memory in single GGC run: 36548k
    Garbage: 293936k
    Leak: 11630k
    Overhead: 35879k
    GGC runs: 385

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 155104k -> 155112k
    Peak memory use before GGC: 116917k
    Peak memory use after GGC: 87325k
    Maximum of released memory in single GGC run: 33172k -> 33167k
    Garbage: 389359k -> 389349k
    Leak: 11490k
    Overhead: 47836k -> 47835k
    GGC runs: 309

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 155104k -> 155100k
    Peak memory use before GGC: 116919k
    Peak memory use after GGC: 87327k
    Maximum of released memory in single GGC run: 33172k -> 33167k
    Garbage: 390153k -> 390145k
    Leak: 11512k
    Overhead: 47959k -> 47959k
    GGC runs: 314 -> 313

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Amount of produced GGC garbage decreased from 246746k to 230976k, overall -6.83%
    Overall memory needed: 125492k -> 124840k
    Peak memory use before GGC: 101337k -> 100696k
    Peak memory use after GGC: 100327k -> 99697k
    Maximum of released memory in single GGC run: 21589k -> 21538k
    Garbage: 246746k -> 230976k
    Leak: 53784k -> 53167k
    Overhead: 42116k -> 40187k
    GGC runs: 349 -> 337

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119560k -> 119224k
    Peak memory use before GGC: 110700k -> 110042k
    Peak memory use after GGC: 98931k -> 98622k
    Maximum of released memory in single GGC run: 20021k -> 19969k
    Garbage: 670447k -> 654619k
    Leak: 59053k -> 58436k
    Overhead: 91126k -> 89198k
    GGC runs: 522 -> 512

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119560k -> 119224k
    Peak memory use before GGC: 110700k -> 110042k
    Peak memory use after GGC: 98931k -> 98623k
    Maximum of released memory in single GGC run: 20020k -> 19969k
    Garbage: 764748k -> 748991k
    Leak: 59938k -> 59321k
    Overhead: 108810k -> 106882k
    GGC runs: 604 -> 593

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 122228k -> 121848k
    Peak memory use before GGC: 113443k -> 112786k
    Peak memory use after GGC: 100490k -> 100128k
    Maximum of released memory in single GGC run: 21377k -> 21328k
    Garbage: 824006k -> 808170k
    Leak: 61125k -> 60523k
    Overhead: 116458k -> 114534k
    GGC runs: 607 -> 594

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-17 20:43:27.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-18 01:15:58.000000000 +0000
@@ -1,3 +1,32 @@
+2005-06-17  Richard Henderson  <rth@redhat.com>
+
+        * tree-vect-transform.c (vect_do_peeling_for_loop_bound): Use
+        initialize_original_copy_tables and free_original_copy_tables.
+        (vect_do_peeling_for_alignment): Likewise.
+
+2005-06-17  Pat Haugen  <pthaugen@us.ibm.com>
+
+	* bb-reorder.c (find_traces_1_round): Use succ block frequency
+	instead of edge frequency for calls to better_edge_p.
+
+2005-06-17  Andrew Pinski  <pinskia@physics.uc.edu>
+
+	PR tree-opt/22105
+	* tree-ssa-loop-im.c (for_each_index): Handle COMPLEX_CST.
+
+2005-06-17  Steve Ellcey  <sje@cup.hp.com>
+
+	PR target/19889
+	* config/ia64/hpux.h (FUNCTION_PROFILER): New (dummy).
+	(PROFILE_HOOK): New.
+	(PROFILE_BEFORE_PROLOGUE): Undef.
+	(NO_PROFILE_COUNTERS): New.
+	* config/ia64/ia64-protos.h (ia64_profile_hook): New.
+	* config/ia64/ia64.c (ia64_compute_frame_size): Add ifdef.
+	(gen_mcount_func_rtx): New.
+	(ia64_profile_hook): New.
+	* config/ia64/ia64.md (ip_value): New.
+
 2005-06-17  Devang Patel  <dpatel@apple.com>
 
 	* config/rs6000/predicates.md (s5bit_cint_operand,
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2005-06-16 09:12:35.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2005-06-18 01:16:03.000000000 +0000
@@ -1,3 +1,10 @@
+2005-06-17  Geoffrey Keating  <geoffk@apple.com>
+
+	PR c++/17413
+	* pt.c (type_unification_real): Apply template type deduction even
+	to procedure parameters that are not dependent on a template
+	parameter.
+
 2005-06-16  Nathan Sidwell  <nathan@codesourcery.com>
 
 	* rtti.c (get_tinfo_decl): Avoid caching tinfo_descs when it might


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