A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Thu Feb 16 03:33: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: 25332k
    Peak memory use before GGC: 9566k
    Peak memory use after GGC: 8914k
    Maximum of released memory in single GGC run: 2649k
    Garbage: 40057k
    Leak: 6740k
    Overhead: 5738k
    GGC runs: 313

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 62424k to 62596k, overall 0.28%
    Overall memory needed: 26900k
    Peak memory use before GGC: 17435k
    Peak memory use after GGC: 17256k
    Maximum of released memory in single GGC run: 2309k
    Garbage: 62424k -> 62596k
    Leak: 6881k -> 6880k
    Overhead: 7479k -> 7485k
    GGC runs: 393

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 82388k to 87554k, overall 6.27%
    Overall memory needed: 26900k
    Peak memory use before GGC: 17438k
    Peak memory use after GGC: 17256k
    Maximum of released memory in single GGC run: 2400k -> 3615k
    Garbage: 82388k -> 87554k
    Leak: 6975k -> 6974k
    Overhead: 10216k -> 10564k
    GGC runs: 460 -> 464

comparing combine.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 18450k to 19249k, overall 4.33%
  Peak amount of GGC memory still allocated after garbage collectin increased from 17990k to 18471k, overall 2.67%
  Amount of produced GGC garbage increased from 113618k to 120149k, overall 5.75%
    Overall memory needed: 26900k
    Peak memory use before GGC: 18450k -> 19249k
    Peak memory use after GGC: 17990k -> 18471k
    Maximum of released memory in single GGC run: 3495k -> 5002k
    Garbage: 113618k -> 120149k
    Leak: 7052k -> 7049k
    Overhead: 13942k -> 14436k
    GGC runs: 518 -> 519

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 80944k
    Peak memory use before GGC: 69508k
    Peak memory use after GGC: 45045k
    Maximum of released memory in single GGC run: 36220k
    Garbage: 146686k
    Leak: 9908k
    Overhead: 19751k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O1 level:
  Overall memory allocated via mmap and sbrk increased from 109248k to 114184k, overall 4.52%
  Peak amount of GGC memory allocated before garbage collecting increased from 92083k to 96841k, overall 5.17%
  Peak amount of GGC memory still allocated after garbage collectin increased from 81242k to 84874k, overall 4.47%
  Amount of produced GGC garbage increased from 296571k to 304572k, overall 2.70%
    Overall memory needed: 109248k -> 114184k
    Peak memory use before GGC: 92083k -> 96841k
    Peak memory use after GGC: 81242k -> 84874k
    Maximum of released memory in single GGC run: 32383k -> 32384k
    Garbage: 296571k -> 304572k
    Leak: 10073k -> 10073k
    Overhead: 36195k -> 37280k
    GGC runs: 246

comparing insn-attrtab.c compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 93799k to 98561k, overall 5.08%
  Peak amount of GGC memory still allocated after garbage collectin increased from 81339k to 84975k, overall 4.47%
  Amount of produced GGC garbage increased from 343842k to 351887k, overall 2.34%
    Overall memory needed: 110784k -> 111572k
    Peak memory use before GGC: 93799k -> 98561k
    Peak memory use after GGC: 81339k -> 84975k
    Maximum of released memory in single GGC run: 31927k
    Garbage: 343842k -> 351887k
    Leak: 10057k -> 10057k
    Overhead: 44791k -> 45876k
    GGC runs: 275 -> 276

comparing insn-attrtab.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 93829k to 98589k, overall 5.07%
  Peak amount of GGC memory still allocated after garbage collectin increased from 81369k to 85002k, overall 4.46%
  Amount of produced GGC garbage increased from 344485k to 352549k, overall 2.34%
    Overall memory needed: 110848k -> 111632k
    Peak memory use before GGC: 93829k -> 98589k
    Peak memory use after GGC: 81369k -> 85002k
    Maximum of released memory in single GGC run: 32267k -> 32268k
    Garbage: 344485k -> 352549k
    Leak: 10061k -> 10062k
    Overhead: 44989k -> 46077k
    GGC runs: 280 -> 281

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: 223447k
    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: 563796k -> 561306k
    Leak: 52250k -> 52212k
    Overhead: 63580k -> 63026k
    GGC runs: 533 -> 532

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 108476k to 113148k, overall 4.31%
  Amount of produced GGC garbage increased from 687293k to 778120k, overall 13.22%
    Overall memory needed: 108476k -> 113148k
    Peak memory use before GGC: 95143k
    Peak memory use after GGC: 93152k
    Maximum of released memory in single GGC run: 20158k
    Garbage: 687293k -> 778120k
    Leak: 53390k -> 53333k
    Overhead: 76857k -> 83885k
    GGC runs: 616 -> 613

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 753466k to 857931k, overall 13.86%
    Overall memory needed: 110792k -> 112668k
    Peak memory use before GGC: 96537k
    Peak memory use after GGC: 94579k
    Maximum of released memory in single GGC run: 20582k
    Garbage: 753466k -> 857931k
    Leak: 54327k -> 54272k
    Overhead: 81648k -> 89436k
    GGC runs: 630 -> 625

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-02-15 16:45:27.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-02-16 03:23:09.000000000 +0000
@@ -1,3 +1,66 @@
+2006-02-16  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	PR rtl-optimization/25636
+	* local-alloc.c (update_equiv_regs): Lose a bogus rtx_equal_p test
+	when deciding whether an insn is an initializing insn.
+
+2006-02-15 Daniel Berlin  <dberlin@dberlin.org>
+
+	* tree.c (init_ttree): Add STRUCT_FIELD_TAG handling.
+	(tree_code_size): Ditto.
+	* tree.h (struct tree_memory_tag): Remove parent_var.
+	(struct tree_struct_field_tag): New.
+	(SFT_OFFSET): New.
+	(SFT_SIZE): New.
+	(union tree_node): Add sft member.
+	* tree-ssa-alias.c (get_tmt_for): Don't handle TYPE_READONLY
+	specially here.
+	(create_sft): Add size and offset argument, set SFT_OFFSET and
+	SFT_SIZE.
+	(create_overlap_variables_for): Update for SFT_OFFSET/SFT_SIZE.
+	* treestruct.def: Add TS_STRUCT_FIELD_TAG.
+	* tree-flow-inline.h (get_subvar_at): Update for
+	SFT_OFFSET/SFT_SIZE.
+	(var_can_have_subvars): Ditto.
+	(overlap_subvar): Ditto.
+	* print-tree.c (print_node): Print out interesting things for
+	SFT's.
+	* tree-flow.h (struct subvar): Remove offset and size members.
+	* tree-ssa-operands.c (get_expr_operands): Update for
+	get_indirect_ref_operands changes.
+	(get_indirect_ref_operands): Call add_virtual_operand instead of
+	add_stmt_operand.  Only recurse on base var if requested.
+	(access_can_touch_variable): New function.
+	(add_stmt_operand): Split virtual operand handling into ...
+	(add_virtual_operand): Here.  Add offset, size, and for_clobber
+	arguments.  Prune alias sets.
+	(add_call_clobber_ops): Call add_virtual_operand.
+	
+2006-02-15  Jakub Jelinek  <jakub@redhat.com>
+
+	PR middle-end/26300
+	* combine.c (make_extraction): Bail out if ORIG_POS is negative.
+
+	* tree.h (struct tree_omp_clause): Use OMP_CLAUSE_CODE rather
+	than TREE_CODE as index into omp_clause_num_ops array.
+
+2006-02-15  Uttam Pawar  <uttamp@us.ibm.com>
+
+	PR rtl-optimization/26184
+	* modulo-sched.c (generate_reg_moves): Free bitmap vector
+	uses_of_defs.
+	* modulo-sched.c (sms_schedule): Free g_arr pointer.
+	* modulo-sched.c (sms_schedule_by_order): Free bitmap pointers
+	must_precede, must_follow and tobe_scheduled.
+
+	PR other/26147
+	* opts.c (common_handle_option): Free new_option pointer.
+	* df-core.c (df_analyze): Free postorder pointer.
+
+2006-02-15  Rafael ?vila de Esp?ndola <rafael.espindola@gmail.com>
+
+	* Makefile.in: Fix the examples about the use of stamps
+
 2006-02-15  Michael Matz  <matz@suse.de>
 
 	PR middle-end/22275
@@ -3683,7 +3746,7 @@
 	* basic-block.h: Remove the prototype for
 	partition_hot_cold_basic_blocks.
 
-2006-01-16  Rafael ?vila de Esp??ndola <rafael.espindola@gmail.com>
+2006-01-16  Rafael ?vila de Esp?????ndola <rafael.espindola@gmail.com>
 
 	* cppspec.c (lang_specific_spec_functions): Remove.
 	* gcc.c (lookup_spec_function): Use static_spec_functions directly.


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