This is the mail archive of the gcc-regression@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A recent patch increased GCC's memory consumption!


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 empty function compilation at -O0 level:
    Overall memory needed: 18349k
    Peak memory use before GGC: 2264k
    Peak memory use after GGC: 1955k
    Maximum of released memory in single GGC run: 309k
    Garbage: 444k
    Leak: 2288k
    Overhead: 455k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 18365k
    Peak memory use before GGC: 2291k
    Peak memory use after GGC: 1982k
    Maximum of released memory in single GGC run: 309k
    Garbage: 447k
    Leak: 2320k
    Overhead: 460k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18457k
    Peak memory use before GGC: 2264k
    Peak memory use after GGC: 1955k
    Maximum of released memory in single GGC run: 309k
    Garbage: 450k
    Leak: 2291k
    Overhead: 456k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18469k
    Peak memory use before GGC: 2265k
    Peak memory use after GGC: 1955k
    Maximum of released memory in single GGC run: 310k
    Garbage: 453k
    Leak: 2291k
    Overhead: 456k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18469k
    Peak memory use before GGC: 2265k
    Peak memory use after GGC: 1955k
    Maximum of released memory in single GGC run: 310k
    Garbage: 453k
    Leak: 2291k
    Overhead: 456k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28633k
    Peak memory use before GGC: 9312k
    Peak memory use after GGC: 8864k
    Maximum of released memory in single GGC run: 2606k
    Garbage: 37297k
    Leak: 6538k
    Overhead: 4829k
    GGC runs: 276

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 30681k
    Peak memory use before GGC: 10895k
    Peak memory use after GGC: 10524k
    Maximum of released memory in single GGC run: 2365k
    Garbage: 37870k
    Leak: 9414k
    Overhead: 5530k
    GGC runs: 271

comparing combine.c compilation at -O1 level:
    Overall memory needed: 33270k
    Peak memory use before GGC: 19924k
    Peak memory use after GGC: 19725k
    Maximum of released memory in single GGC run: 2264k
    Garbage: 55197k -> 55193k
    Leak: 6566k
    Overhead: 9960k -> 9959k
    GGC runs: 353 -> 352

comparing combine.c compilation at -O2 level:
    Overall memory needed: 33274k
    Peak memory use before GGC: 19933k
    Peak memory use after GGC: 19735k
    Maximum of released memory in single GGC run: 2206k
    Garbage: 70935k -> 70931k
    Leak: 6694k
    Overhead: 11862k -> 11862k
    GGC runs: 410

comparing combine.c compilation at -O3 level:
    Overall memory needed: 32470k
    Peak memory use before GGC: 20881k
    Peak memory use after GGC: 20311k
    Maximum of released memory in single GGC run: 3125k
    Garbage: 103325k -> 103323k
    Leak: 6768k
    Overhead: 16334k -> 16334k
    GGC runs: 470

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 89190k
    Peak memory use before GGC: 70731k
    Peak memory use after GGC: 44750k
    Maximum of released memory in single GGC run: 37355k
    Garbage: 131553k
    Leak: 9580k
    Overhead: 16626k
    GGC runs: 210

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 90366k
    Peak memory use before GGC: 71893k
    Peak memory use after GGC: 46017k
    Maximum of released memory in single GGC run: 37357k
    Garbage: 132717k
    Leak: 11269k
    Overhead: 17020k
    GGC runs: 209

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 98150k -> 98154k
    Peak memory use before GGC: 72561k
    Peak memory use after GGC: 68716k
    Maximum of released memory in single GGC run: 31302k
    Garbage: 227952k -> 227951k
    Leak: 9397k
    Overhead: 29388k -> 29388k
    GGC runs: 223

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 105162k -> 105158k
    Peak memory use before GGC: 79387k
    Peak memory use after GGC: 73577k
    Maximum of released memory in single GGC run: 29594k
    Garbage: 279218k -> 279218k
    Leak: 9395k
    Overhead: 35694k -> 35694k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 109998k -> 109994k
    Peak memory use before GGC: 79427k
    Peak memory use after GGC: 73617k
    Maximum of released memory in single GGC run: 29758k
    Garbage: 279917k -> 279917k
    Leak: 9399k
    Overhead: 35905k -> 35905k
    GGC runs: 245

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119778k
    Peak memory use before GGC: 93022k
    Peak memory use after GGC: 92099k
    Maximum of released memory in single GGC run: 18912k
    Garbage: 208221k
    Leak: 49015k
    Overhead: 21199k
    GGC runs: 407

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 132278k
    Peak memory use before GGC: 105299k
    Peak memory use after GGC: 104254k
    Maximum of released memory in single GGC run: 18752k
    Garbage: 214808k
    Leak: 72442k
    Overhead: 27104k
    GGC runs: 382

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 130302k -> 130334k
    Peak memory use before GGC: 98615k -> 98685k
    Peak memory use after GGC: 97638k -> 97707k
    Maximum of released memory in single GGC run: 17925k
    Garbage: 394895k -> 395085k
    Leak: 50037k -> 50038k
    Overhead: 53231k -> 53237k
    GGC runs: 572

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 451692k to 452204k, overall 0.11%
    Overall memory needed: 130362k -> 130394k
    Peak memory use before GGC: 98683k -> 98752k
    Peak memory use after GGC: 97705k -> 97773k
    Maximum of released memory in single GGC run: 17924k
    Garbage: 451692k -> 452204k
    Leak: 50815k -> 50820k
    Overhead: 46288k -> 46371k
    GGC runs: 633 -> 632

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 132178k -> 132210k
    Peak memory use before GGC: 100272k -> 100342k
    Peak memory use after GGC: 99239k -> 99308k
    Maximum of released memory in single GGC run: 18325k
    Garbage: 467160k -> 467189k
    Leak: 51029k -> 51028k
    Overhead: 45801k -> 45791k
    GGC runs: 642

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137646k
    Peak memory use before GGC: 81607k
    Peak memory use after GGC: 58487k
    Maximum of released memory in single GGC run: 44559k
    Garbage: 148154k
    Leak: 8080k
    Overhead: 25066k
    GGC runs: 81

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 138198k
    Peak memory use before GGC: 82253k
    Peak memory use after GGC: 59133k
    Maximum of released memory in single GGC run: 44208k
    Garbage: 148325k
    Leak: 9335k
    Overhead: 25561k
    GGC runs: 89

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 436710k -> 436694k
    Peak memory use before GGC: 202594k
    Peak memory use after GGC: 192571k
    Maximum of released memory in single GGC run: 137171k
    Garbage: 278226k
    Leak: 29804k
    Overhead: 32030k
    GGC runs: 92

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 365202k -> 367434k
    Peak memory use before GGC: 207227k
    Peak memory use after GGC: 192563k
    Maximum of released memory in single GGC run: 140362k
    Garbage: 355277k
    Leak: 30387k
    Overhead: 47185k
    GGC runs: 98

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 710702k
    Peak memory use before GGC: 282245k
    Peak memory use after GGC: 273215k
    Maximum of released memory in single GGC run: 138326k
    Garbage: 448504k
    Leak: 45440k
    Overhead: 56089k
    GGC runs: 97

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-01-15 13:26:50.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-01-16 04:54:44.000000000 +0000
@@ -1,3 +1,32 @@
+2007-01-15  Eric Christopher  <echristo@apple.com>
+
+	* config/darwin.h: Update copyright.
+	(TARGET_OPTION_TRANSLATE_TABLE): Add umbrella.
+	(LINK_COMMAND_SPEC): Add -u.
+	(LINK_SPEC): Fix umbrella for above.
+
+2007-01-15  Joseph S. Myers  <joseph@codesourcery.com>
+
+	* config/soft-fp/op-common.h, config/soft-fp/op-4.h: Update from
+	glibc CVS.
+
+2007-01-15  Tom Tromey  <tromey@redhat.com>
+
+	* doc/sourcebuild.texi (libgcj Tests): Don't mention jacks.
+	* doc/install.texi (Testing): Don't mention jacks.
+	(Configuration): Document --enable-java-maintainer-mode.  Move
+	--with-java-home to libgcj-specific section.  Document
+	--with-ecj-jar.
+	(Prerequisites): Mention --enable-java-maintainer-mode, ecj1.
+
+2007-01-15  Jan Hubicka  <jh@suse.cz>
+
+	* tree-ssa-dce.c (DCE_TODOs): New.
+	(propagate_necessity): Return if something changed.
+	(eliminate_unnecessary_stmts): Likewise.
+	(perform_tree_ssa_dce): Return TODO flags when needed.
+	(pass_dce, pass_dce_loop, pass_cd_dce): Remove TODO flags.
+
 2007-01-15  Uros Bizjak  <ubizjak@gmail.com>
 
 	* config/i386/i386.md (fyl2xxf3_i387): Rename from fyl2x_xf3.
@@ -30,10 +59,10 @@
 	* param.h (MIN_VECT_LOOP_BOUND): New.
 	* params.def (MIN_VECT_LOOP_BOUND): New.
 	* tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Takes another
-	argument - minimum threshold for number of iterations. 
+	argument - minimum threshold for number of iterations.
 	* tree-vectorizer.h (slpeel_tree_peel_loop_to_edge): Add another
 	argument to declaration.
-	* tree-vect-analyze.c (vect_analyze_operations): Check value of 
+	* tree-vect-analyze.c (vect_analyze_operations): Check value of
 	MIN_VECT_LOOP_BOUND.
 	* tree-vect-transform.c (vect_do_peeling_for_loop_bound): Call
 	slpeel_tree_peel_loop_to_edge with additional argument.
@@ -106,7 +135,7 @@
 2007-01-12  Olga Golovanevsky  <olga@il.ibm.com>
 
 	* builtins.def : Add BUILT_IN_FREE.
-	
+
 2007-01-12  Jan Hubicka  <jh@suse.cz>
 
 	PR tree-optimization/30443
@@ -623,10 +652,10 @@
 2007-01-10  Razya Ladelsky  <razya@il.ibm.com>
 
 	* function.c (get_last_funcdef_no): New function.
-	* function.h (get_last_funcdef_no): Declare. 
+	* function.h (get_last_funcdef_no): Declare.
 	* tree-inline.c (initialize_cfun): Add initialization.
 	(tree_function_versioning): Cleanup.
-	
+
 2007-01-10  Jan Hubicka  <jh@suse.cz>
 
 	* tree-inline.c (setup_one_parameter): Do not propagate into abnormal
@@ -713,7 +742,7 @@
 	(fold_sign_changed_comparison): Likewise.
 	(fold_unary): Likewise.
 	(fold_negate_const): Likewise.
-	(fold_abs_const): Likewise. 
+	(fold_abs_const): Likewise.
 	(fold_not_const): Likewise.
 	* c-common.c (shorten_compare): Use force_fit_type_double.
 	* convert.c (convert_to_pointer): Likewise.
@@ -885,9 +914,9 @@
 	* config/score/t-score-elf (MULTILIB_OPTIONS): Change.
 	* config/score/predicates.md (const_uimm5, sr0_operand, const_simm12,
 	const_simm15, const_pow2, const_npow2): Added.
-	* config/score/misc.md (insv, extv, extzv, movmemsi, 
+	* config/score/misc.md (insv, extv, extzv, movmemsi,
 	move_lbu_a/b, mov_lhu_a/b etc): Added and fix some bug.
-	* config/score/score.c (score_address_cost, score_select_cc_mode): 
+	* config/score/score.c (score_address_cost, score_select_cc_mode):
 	Added.
 	Change CONST_OK_FOR_LETTER_P/EXTRA_CONSTRAINT define.
 	Update score_rtx_costs for MACRO TARGET_RTX_COSTS.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]