A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Mon Oct 3 15:10: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: 24873k -> 24877k
    Peak memory use before GGC: 9590k -> 9594k
    Peak memory use after GGC: 8937k -> 8941k
    Maximum of released memory in single GGC run: 2737k
    Garbage: 40100k -> 40085k
    Leak: 6698k -> 6702k
    Overhead: 5787k -> 5787k
    GGC runs: 316

comparing combine.c compilation at -O1 level:
    Overall memory needed: 26812k -> 26816k
    Peak memory use before GGC: 17359k -> 17363k
    Peak memory use after GGC: 17173k -> 17177k
    Maximum of released memory in single GGC run: 2373k
    Garbage: 60378k -> 60371k
    Leak: 7081k -> 7085k
    Overhead: 7596k -> 7596k
    GGC runs: 385

comparing combine.c compilation at -O2 level:
    Overall memory needed: 26812k -> 26816k
    Peak memory use before GGC: 17361k -> 17365k
    Peak memory use after GGC: 17173k -> 17177k
    Maximum of released memory in single GGC run: 2453k -> 2454k
    Garbage: 77463k -> 77462k
    Leak: 7476k -> 7480k
    Overhead: 10083k -> 10087k
    GGC runs: 457

comparing combine.c compilation at -O3 level:
    Overall memory needed: 26812k -> 26816k
    Peak memory use before GGC: 18469k -> 18474k
    Peak memory use after GGC: 18099k -> 18103k
    Maximum of released memory in single GGC run: 3361k -> 3362k
    Garbage: 110523k -> 110522k
    Leak: 7564k -> 7569k
    Overhead: 13913k -> 13913k
    GGC runs: 516

comparing insn-attrtab.c compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 9851k to 10095k, overall 2.48%
    Overall memory needed: 80916k -> 80920k
    Peak memory use before GGC: 69464k -> 69468k
    Peak memory use after GGC: 45002k -> 45006k
    Maximum of released memory in single GGC run: 36248k
    Garbage: 146604k -> 146337k
    Leak: 9851k -> 10095k
    Overhead: 19791k -> 19790k
    GGC runs: 251 -> 250

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 111884k -> 112284k
    Peak memory use before GGC: 94161k -> 94165k
    Peak memory use after GGC: 83708k -> 83712k
    Maximum of released memory in single GGC run: 32586k
    Garbage: 290030k -> 290030k
    Leak: 10077k -> 10081k
    Overhead: 36692k -> 36692k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 127108k -> 127112k
    Peak memory use before GGC: 113407k -> 113411k
    Peak memory use after GGC: 83668k -> 83672k
    Maximum of released memory in single GGC run: 32200k
    Garbage: 376128k -> 376137k
    Leak: 10183k -> 10187k
    Overhead: 48586k -> 48586k
    GGC runs: 274

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 127168k -> 127176k
    Peak memory use before GGC: 113433k -> 113437k
    Peak memory use after GGC: 83695k -> 83700k
    Maximum of released memory in single GGC run: 32515k
    Garbage: 376674k -> 376679k
    Leak: 10199k -> 10203k
    Overhead: 48736k -> 48736k
    GGC runs: 276

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 118144k -> 118148k
    Peak memory use before GGC: 94915k -> 94920k
    Peak memory use after GGC: 93968k -> 93973k
    Maximum of released memory in single GGC run: 20293k
    Garbage: 225923k -> 225925k
    Leak: 49143k -> 49147k
    Overhead: 36818k -> 36819k
    GGC runs: 369

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 105436k -> 105432k
    Peak memory use before GGC: 95204k -> 95209k
    Peak memory use after GGC: 92602k -> 92607k
    Maximum of released memory in single GGC run: 20357k
    Garbage: 569873k -> 569871k
    Leak: 55385k -> 55389k
    Overhead: 67786k -> 67787k
    GGC runs: 516

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 106192k
    Peak memory use before GGC: 95204k -> 95209k
    Peak memory use after GGC: 92602k -> 92607k
    Maximum of released memory in single GGC run: 20356k
    Garbage: 652061k -> 652072k
    Leak: 56166k -> 56171k
    Overhead: 79099k -> 79098k
    GGC runs: 582

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 109340k -> 109380k
    Peak memory use before GGC: 96495k -> 96500k
    Peak memory use after GGC: 94544k -> 94549k
    Maximum of released memory in single GGC run: 20676k
    Garbage: 708529k -> 708536k
    Leak: 57200k -> 57204k
    Overhead: 84153k -> 84154k
    GGC runs: 585

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-10-02 21:37:50.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-10-03 14:01:19.000000000 +0000
@@ -1,3 +1,25 @@
+2005-10-03  Ian Lance Taylor  <ian@airs.com>
+
+	* gimplify.c (find_single_pointer_decl_1): New static function.
+	(find_single_pointer_decl): New static function.
+	(internal_get_tmp_var): For a formal variable, set restrict base
+	information if appropriate.
+	* alias.c (find_base_decl): If a VAR_DECL has a restrict base,
+	return it.
+	* tree.h (DECL_BASED_ON_RESTRICT_P): Define.
+	(DECL_GET_RESTRICT_BASE): Define.
+	(SET_DECL_RESTRICT_BASE): Define.
+	(decl_restrict_base_lookup): Declare.
+	(decl_restrict_base_insert): Declare.
+	(struct tree_decl_with_vis): Add based_on_restrict_p field.
+	* tree.c (restrict_base_for_decl): New static variable.
+	(init_ttree): Initialize restrict_base_for_decl.
+	(copy_node_stat): Copy restrict base information.
+	(decl_restrict_base_lookup): New function.
+	(decl_restrict_base_insert): New function.
+	(print_restrict_base_statistics): New static function.
+	(dump_tree_statistics): Call print_restrict_base_statistics.
+
 2005-10-02  Diego Novillo  <dnovillo@redhat.com>
 
 	PR 24142


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