A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Tue Jun 28 02: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:
  Peak amount of GGC memory allocated before garbage collecting increased from 9696k to 9717k, overall 0.22%
  Peak amount of GGC memory still allocated after garbage collectin increased from 9043k to 9064k, overall 0.23%
  Amount of produced GGC garbage increased from 42058k to 42310k, overall 0.60%
    Overall memory needed: 24880k -> 24896k
    Peak memory use before GGC: 9696k -> 9717k
    Peak memory use after GGC: 9043k -> 9064k
    Maximum of released memory in single GGC run: 2793k -> 2815k
    Garbage: 42058k -> 42310k
    Leak: 6719k -> 6721k
    Overhead: 5755k -> 5842k
    GGC runs: 334

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 67338k to 67468k, overall 0.19%
    Overall memory needed: 24244k -> 24240k
    Peak memory use before GGC: 17699k
    Peak memory use after GGC: 17518k
    Maximum of released memory in single GGC run: 2345k -> 2364k
    Garbage: 67338k -> 67468k
    Leak: 7031k
    Overhead: 8265k -> 8384k
    GGC runs: 417

comparing combine.c compilation at -O2 level:
    Overall memory needed: 24244k
    Peak memory use before GGC: 17696k
    Peak memory use after GGC: 17518k
    Maximum of released memory in single GGC run: 2511k -> 2512k
    Garbage: 86911k -> 86783k
    Leak: 7210k
    Overhead: 10992k -> 11125k
    GGC runs: 489 -> 484

comparing combine.c compilation at -O3 level:
    Overall memory needed: 24736k -> 24728k
    Peak memory use before GGC: 17695k
    Peak memory use after GGC: 17518k
    Maximum of released memory in single GGC run: 3429k -> 3436k
    Garbage: 115729k -> 115602k
    Leak: 7321k -> 7305k
    Overhead: 14726k -> 14917k
    GGC runs: 534 -> 535

comparing insn-attrtab.c compilation at -O0 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 71265k to 71655k, overall 0.55%
  Peak amount of GGC memory still allocated after garbage collectin increased from 45286k to 45752k, overall 1.03%
  Amount of produced GGC garbage increased from 150146k to 151887k, overall 1.16%
    Overall memory needed: 82992k -> 83372k
    Peak memory use before GGC: 71265k -> 71655k
    Peak memory use after GGC: 45286k -> 45752k
    Maximum of released memory in single GGC run: 37299k -> 37689k
    Garbage: 150146k -> 151887k
    Leak: 11560k -> 11321k
    Overhead: 18388k -> 18884k
    GGC runs: 266 -> 267

comparing insn-attrtab.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 294823k to 295549k, overall 0.25%
    Overall memory needed: 115848k
    Peak memory use before GGC: 98141k
    Peak memory use after GGC: 87548k
    Maximum of released memory in single GGC run: 33046k -> 33389k
    Garbage: 294823k -> 295549k
    Leak: 11440k
    Overhead: 35901k -> 36620k
    GGC runs: 272 -> 273

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 155324k -> 155092k
    Peak memory use before GGC: 117226k
    Peak memory use after GGC: 87536k
    Maximum of released memory in single GGC run: 33167k -> 33533k
    Garbage: 390807k -> 390254k
    Leak: 11520k
    Overhead: 47869k -> 48724k
    GGC runs: 307 -> 306

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 155340k -> 155088k
    Peak memory use before GGC: 117228k
    Peak memory use after GGC: 87538k
    Maximum of released memory in single GGC run: 33167k -> 33533k
    Garbage: 391600k -> 391041k
    Leak: 11540k
    Overhead: 47991k -> 48848k
    GGC runs: 311

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Amount of produced GGC garbage increased from 228947k to 230059k, overall 0.49%
    Overall memory needed: 124868k
    Peak memory use before GGC: 100723k -> 100729k
    Peak memory use after GGC: 99725k
    Maximum of released memory in single GGC run: 21553k -> 21556k
    Garbage: 228947k -> 230059k
    Leak: 53183k -> 53186k
    Overhead: 39627k -> 40063k
    GGC runs: 335

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 653289k to 654676k, overall 0.21%
    Overall memory needed: 119248k
    Peak memory use before GGC: 110058k
    Peak memory use after GGC: 98650k
    Maximum of released memory in single GGC run: 19966k
    Garbage: 653289k -> 654676k
    Leak: 58231k -> 58232k
    Overhead: 88666k -> 89931k
    GGC runs: 514

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119252k
    Peak memory use before GGC: 110059k
    Peak memory use after GGC: 98651k
    Maximum of released memory in single GGC run: 19967k
    Garbage: 749090k -> 749549k
    Leak: 59269k
    Overhead: 106368k -> 107685k
    GGC runs: 587 -> 585

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 121560k
    Peak memory use before GGC: 112859k
    Peak memory use after GGC: 99839k
    Maximum of released memory in single GGC run: 21384k
    Garbage: 807866k -> 808374k
    Leak: 60594k
    Overhead: 114054k -> 115452k
    GGC runs: 597

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-27 20:36:00.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-28 01:04:38.000000000 +0000
@@ -1,3 +1,46 @@
+2005-06-27  Diego Novillo  <dnovillo@redhat.com>
+
+	PR 21959
+	* tree-ssa-loop-niter.c (scev_probably_wraps_p): Handle type
+	casts between unsigned and signed types with different size
+	or precision.
+
+2005-06-28  Jan Hubicka  <jh@suse.cz>
+
+	* tree-optimize.c (exercute_free_datastructures):
+	Do not disband implicit edges; do not attempt to build insn list;
+	do not free cfg annotations.
+	(execute_free_cfg_annotations); Disband implicit edges here;
+	free cfg annotations here too.
+	(pass_free_cfg_annotations); New pass.
+	(init_tree_optimization_passes); Add pass_free_cfg_annotations.
+	* tree-ssa-operands.c (free_ssa_operands); Recover; export.
+	* tree-ssa-operands.h (free_ssa_operands); declare.
+	* tree-ssa.c (delete_tree_ssa); Free SSA operand; mark stmt modified;
+	kill PHI nodes.
+	* tree-ssanames.c (release_defs): Kill addresses_taken.
+
+	* basic-block.h (basic_block_def): Kill rbi.
+	(reorder_block_def): Kill; Remove next field (replaced by aux);
+	move other fields to ...
+	(rtl_bb_info): ... here.
+	* bb-reorder.c (find_traces, rotate_loop, find_traces_1_round,
+	copy_bb, connect_traces, add_labels_and_missing_jumps
+	fix_up_fall_thru_edges, fix_crossing_conditional_branches,
+	duplicate_computed_gotos, partition_hot_cold_basic-blocks):
+	Update to new fields.
+	* cfg.c (initialize_bb_rbi): Kill.
+	* cfglayout.c (record_effective_endpoints, fixup_reorder_chain,
+	fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update.
+	* cfgrtl.c (cfg_layout_create_basic_block): Do not initialize rbi.
+	(try_redirect_by_replacing_jump): Update rbi references.
+	(cfg_layout_split_block): Likewise.
+	(cfg_layout_delete_block): Likewise.
+	(cfg_layout_merge_blocks): Likewise.
+	* function.c (thread_prologue_and_epilogue_insns): Likewise.
+	* passes.c (rest_of_handle_sms): Likewise.
+	* tracer.c (seen, tail_duplicate, layout_superblocks): Likewise.
+
 2005-06-27  David Edelsohn  <edelsohn@gnu.org>
 
 	* config/rs6000/rs6000.c (rs6000_file_start): Note PPC405 erratum


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