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: 7026k
    Peak memory use before GGC: 1156k
    Peak memory use after GGC: 1061k
    Maximum of released memory in single GGC run: 122k
    Garbage: 239k
    Leak: 1077k
    Overhead: 147k
    GGC runs: 4

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7042k
    Peak memory use before GGC: 1184k
    Peak memory use after GGC: 1089k
    Maximum of released memory in single GGC run: 123k
    Garbage: 242k
    Leak: 1109k
    Overhead: 152k
    GGC runs: 4

comparing empty function compilation at -O1 level:
    Overall memory needed: 7082k
    Peak memory use before GGC: 1156k
    Peak memory use after GGC: 1053k
    Maximum of released memory in single GGC run: 116k
    Garbage: 241k
    Leak: 1078k
    Overhead: 148k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 7102k
    Peak memory use before GGC: 1157k
    Peak memory use after GGC: 1054k
    Maximum of released memory in single GGC run: 117k
    Garbage: 245k
    Leak: 1079k
    Overhead: 148k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 7102k
    Peak memory use before GGC: 1157k
    Peak memory use after GGC: 1054k
    Maximum of released memory in single GGC run: 117k
    Garbage: 245k
    Leak: 1079k
    Overhead: 148k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 22050k
    Peak memory use before GGC: 8292k
    Peak memory use after GGC: 7631k
    Maximum of released memory in single GGC run: 1581k
    Garbage: 38803k
    Leak: 6197k
    Overhead: 5051k
    GGC runs: 371

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 24058k
    Peak memory use before GGC: 10122k
    Peak memory use after GGC: 9396k
    Maximum of released memory in single GGC run: 1875k
    Garbage: 39152k
    Leak: 9036k
    Overhead: 5723k
    GGC runs: 344

comparing combine.c compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 17037k to 17073k, overall 0.21%
  Peak amount of GGC memory still allocated after garbage collecting increased from 16838k to 16885k, overall 0.28%
  Amount of produced GGC garbage increased from 52335k to 52434k, overall 0.19%
    Overall memory needed: 33138k
    Peak memory use before GGC: 17037k -> 17073k
    Peak memory use after GGC: 16838k -> 16885k
    Maximum of released memory in single GGC run: 1379k -> 1378k
    Garbage: 52335k -> 52434k
    Leak: 6356k -> 6348k
    Overhead: 6020k -> 6032k
    GGC runs: 440 -> 441

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 71219k to 71321k, overall 0.14%
    Overall memory needed: 35386k -> 35398k
    Peak memory use before GGC: 17144k -> 17143k
    Peak memory use after GGC: 16973k
    Maximum of released memory in single GGC run: 1335k
    Garbage: 71219k -> 71321k
    Leak: 6674k -> 6675k
    Overhead: 8275k -> 8287k
    GGC runs: 507 -> 509

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 92528k to 92716k, overall 0.20%
    Overall memory needed: 39906k -> 39886k
    Peak memory use before GGC: 17377k -> 17372k
    Peak memory use after GGC: 17027k
    Maximum of released memory in single GGC run: 2131k -> 2130k
    Garbage: 92528k -> 92716k
    Leak: 6800k -> 6789k
    Overhead: 10702k -> 10763k
    GGC runs: 538

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 138498k
    Peak memory use before GGC: 58645k
    Peak memory use after GGC: 32139k
    Maximum of released memory in single GGC run: 34143k
    Garbage: 131577k
    Leak: 8939k
    Overhead: 14855k
    GGC runs: 296

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 139750k -> 139754k
    Peak memory use before GGC: 59795k
    Peak memory use after GGC: 33288k
    Maximum of released memory in single GGC run: 34144k
    Garbage: 131805k
    Leak: 10615k
    Overhead: 15236k
    GGC runs: 290

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 149606k -> 149614k
    Peak memory use before GGC: 57143k
    Peak memory use after GGC: 50913k
    Maximum of released memory in single GGC run: 24232k
    Garbage: 212473k -> 212474k
    Leak: 9831k
    Overhead: 24860k -> 24860k
    GGC runs: 320

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 187374k -> 187378k
    Peak memory use before GGC: 57777k
    Peak memory use after GGC: 52506k
    Maximum of released memory in single GGC run: 22944k -> 22972k
    Garbage: 253708k -> 253940k
    Leak: 10919k -> 10918k
    Overhead: 30573k -> 30607k
    GGC runs: 350 -> 351

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 194398k -> 194394k
    Peak memory use before GGC: 69770k
    Peak memory use after GGC: 63203k
    Maximum of released memory in single GGC run: 23329k -> 23358k
    Garbage: 280470k -> 280700k
    Leak: 10924k -> 10924k
    Overhead: 32339k -> 32373k
    GGC runs: 350 -> 351

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 155165k -> 155169k
    Peak memory use before GGC: 89693k
    Peak memory use after GGC: 88800k
    Maximum of released memory in single GGC run: 18062k
    Garbage: 210298k
    Leak: 52988k
    Overhead: 26476k
    GGC runs: 418

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 175461k
    Peak memory use before GGC: 101997k
    Peak memory use after GGC: 100987k
    Maximum of released memory in single GGC run: 18268k
    Garbage: 216154k
    Leak: 75856k
    Overhead: 32156k
    GGC runs: 386

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 296452k to 297894k, overall 0.49%
    Overall memory needed: 121619k -> 121663k
    Peak memory use before GGC: 88593k
    Peak memory use after GGC: 87715k
    Maximum of released memory in single GGC run: 17330k
    Garbage: 296452k -> 297894k
    Leak: 52239k -> 52239k
    Overhead: 30720k -> 30852k
    GGC runs: 515 -> 517

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 363161k to 364871k, overall 0.47%
    Overall memory needed: 127155k -> 127087k
    Peak memory use before GGC: 88772k
    Peak memory use after GGC: 87885k
    Maximum of released memory in single GGC run: 17312k
    Garbage: 363161k -> 364871k
    Leak: 53321k -> 53322k
    Overhead: 37887k -> 38024k
    GGC runs: 590 -> 593

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 390103k to 391984k, overall 0.48%
    Overall memory needed: 131135k -> 131215k
    Peak memory use before GGC: 89878k
    Peak memory use after GGC: 88984k
    Maximum of released memory in single GGC run: 17671k
    Garbage: 390103k -> 391984k
    Leak: 53569k -> 53578k
    Overhead: 40275k -> 40491k
    GGC runs: 609 -> 612

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 379364k
    Peak memory use before GGC: 101487k
    Peak memory use after GGC: 57140k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179439k
    Leak: 6289k
    Overhead: 30886k
    GGC runs: 107

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 380180k
    Peak memory use before GGC: 102120k
    Peak memory use after GGC: 57774k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179527k
    Leak: 7997k
    Overhead: 31352k
    GGC runs: 110

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 294198k -> 294594k
    Peak memory use before GGC: 80800k
    Peak memory use after GGC: 73181k
    Maximum of released memory in single GGC run: 40023k
    Garbage: 235769k
    Leak: 15627k
    Overhead: 31951k
    GGC runs: 105

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 270062k -> 270094k
    Peak memory use before GGC: 78168k
    Peak memory use after GGC: 73182k
    Maximum of released memory in single GGC run: 33750k
    Garbage: 245807k
    Leak: 15716k
    Overhead: 34176k
    GGC runs: 118

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Amount of produced GGC garbage increased from 356756k to 357337k, overall 0.16%
    Overall memory needed: 1017626k -> 1017622k
    Peak memory use before GGC: 166810k
    Peak memory use after GGC: 156373k
    Maximum of released memory in single GGC run: 83494k
    Garbage: 356756k -> 357337k
    Leak: 25859k
    Overhead: 46147k -> 46219k
    GGC runs: 99

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-09-08 12:39:18.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-09-09 03:18:48.000000000 +0000
@@ -1,3 +1,51 @@
+2007-09-09  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
+
+	Revert:
+	2007-09-05  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
+	* regrename.c (copyprop_hardreg_forward_1): New variable next. Use
+	FOR_BB_INSNS_SAFE instead of for loop.
+	* cse.c (cse_extended_basic_block): Likewise.
+	* postreload.c (reload_cse_regs_1): New variable next. Make sure
+	that the for loop does not invoke NEXT_INSN on a deleted insn.
+	* function.c (instantiate_virtual_regs): Likewise.
+	* lower-subreg.c (remove_retval_note): Likewise.
+	(decompose_multiword_subregs): Use FOR_BB_INSNS_SAFE instead of
+	FOR_BB_INSNS.
+	* emit-rtl.c (remove_insn): Set NEXT_INSN and PREV_INSN to NULL on
+	a deleted insn.
+	* cfgrtl.c (delete_insn): Set JUMP_LABEL to NULL on a deleted
+	insn, if it's a jump.
+	(try_redirect_by_replacing_jump): New variable jump_p. Call
+	tablejump_p before delete_insn_chain.
+	* reload1.c (reload): New variable next. Make sure that the for
+	loop does not invoke NEXT_INSN on a deleted insn.
+	(fixup_eh_region_note): Make the loop terminate if i becomes NULL.
+	(delete_output_reload): New variable prev. Make sure the the for
+	loops do not invoke PREV_INSN on a deleted insn.
+
+2007-09-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* pa/constraints.md: Remove 'X' from unused letters comment.
+
+2007-09-08  Richard Guenther  <rguenther@suse.de>
+
+	* tree-tailcall.c (find_tail_calls): If we don't have aliases
+	computed check stmt_ann->references_memory instead of counting
+	virtual operands.
+ 
+2007-09-08  Segher Boessenkool  <segher@kernel.crashing.org>
+
+	* cse.c (fold_rtx): Use validate_unshare_change() instead of
+	validate_change() in one more case.
+
+2007-09-08  Zdenek Dvorak  <ook@ucw.cz>
+
+	PR tree-optimization/32283
+	* tree-ssa-loop-ivopts.c (may_eliminate_iv): Use
+	estimated_loop_iterations.
+	(determine_use_iv_cost_condition): Decrease cost of expressions
+	used in iv elimination.
+
 2007-09-08  Richard Guenther  <rguenther@suse.de>
 
 	* tree-cfg.c (verify_gimple_expr): Avoid building new


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]