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 decreased 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 combine.c compilation at -O0 level:
    Overall memory needed: 25344k -> 24796k
    Peak memory use before GGC: 9720k -> 9665k
    Peak memory use after GGC: 9068k -> 9012k
    Maximum of released memory in single GGC run: 2822k -> 2790k
    Garbage: 42600k -> 42031k
    Leak: 6715k -> 6674k
    Overhead: 6087k -> 5767k
    GGC runs: 338

comparing combine.c compilation at -O1 level:
    Overall memory needed: 16816k -> 16756k
    Peak memory use before GGC: 9197k -> 9123k
    Peak memory use after GGC: 8703k -> 8606k
    Maximum of released memory in single GGC run: 2147k -> 2119k
    Garbage: 65223k -> 64084k
    Leak: 7174k -> 7133k
    Overhead: 8518k -> 7970k
    GGC runs: 532 -> 530

comparing combine.c compilation at -O2 level:
    Overall memory needed: 24580k -> 24208k
    Peak memory use before GGC: 18011k -> 17653k
    Peak memory use after GGC: 17831k -> 17473k
    Maximum of released memory in single GGC run: 2529k -> 2498k
    Garbage: 88023k -> 86711k
    Leak: 7158k
    Overhead: 11594k -> 10984k
    GGC runs: 493 -> 494

comparing combine.c compilation at -O3 level:
    Overall memory needed: 24856k -> 24468k
    Peak memory use before GGC: 18023k -> 17666k
    Peak memory use after GGC: 17831k -> 17473k
    Maximum of released memory in single GGC run: 3129k -> 3081k
    Garbage: 117653k -> 115798k
    Leak: 7270k
    Overhead: 15628k -> 14751k
    GGC runs: 544

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 84908k -> 82956k
    Peak memory use before GGC: 72708k -> 70948k
    Peak memory use after GGC: 45964k -> 45255k
    Maximum of released memory in single GGC run: 37597k -> 37011k
    Garbage: 152787k -> 149822k
    Leak: 11547k -> 11290k
    Overhead: 20131k -> 18393k
    GGC runs: 270

comparing insn-attrtab.c compilation at -O1 level:
  Peak amount of GGC memory still allocated after garbage collecting decreased from 64315k to 62378k, overall -3.11%
    Overall memory needed: 100452k -> 98692k
    Peak memory use before GGC: 75048k -> 72971k
    Peak memory use after GGC: 64315k -> 62378k
    Maximum of released memory in single GGC run: 37075k -> 36546k
    Garbage: 302143k -> 293936k
    Leak: 11648k -> 11630k
    Overhead: 39579k -> 35879k
    GGC runs: 385

comparing insn-attrtab.c compilation at -O2 level:
  Peak amount of GGC memory still allocated after garbage collecting decreased from 90189k to 87325k, overall -3.28%
    Overall memory needed: 156976k -> 155120k
    Peak memory use before GGC: 119401k -> 116917k
    Peak memory use after GGC: 90189k -> 87325k
    Maximum of released memory in single GGC run: 33313k -> 32776k
    Garbage: 398463k -> 389364k
    Leak: 11490k
    Overhead: 52007k -> 47836k
    GGC runs: 309

comparing insn-attrtab.c compilation at -O3 level:
  Peak amount of GGC memory still allocated after garbage collecting decreased from 90191k to 87327k, overall -3.28%
    Overall memory needed: 156988k -> 155092k
    Peak memory use before GGC: 119403k -> 116919k
    Peak memory use after GGC: 90191k -> 87327k
    Maximum of released memory in single GGC run: 33313k -> 32776k
    Garbage: 399267k -> 390153k
    Leak: 11512k
    Overhead: 52135k -> 47959k
    GGC runs: 314

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 126456k -> 125492k
    Peak memory use before GGC: 102205k -> 101337k
    Peak memory use after GGC: 101183k -> 100327k
    Maximum of released memory in single GGC run: 21146k -> 21589k
    Garbage: 249862k -> 246746k
    Leak: 53786k -> 53784k
    Overhead: 43733k -> 42114k
    GGC runs: 350 -> 349

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 121192k -> 119560k
    Peak memory use before GGC: 111851k -> 110700k
    Peak memory use after GGC: 100453k -> 98931k
    Maximum of released memory in single GGC run: 19965k -> 20021k
    Garbage: 688283k -> 670403k
    Leak: 59055k
    Overhead: 98756k -> 91120k
    GGC runs: 524 -> 523

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 121192k -> 119560k
    Peak memory use before GGC: 111852k -> 110700k
    Peak memory use after GGC: 100454k -> 98931k
    Maximum of released memory in single GGC run: 19966k -> 20020k
    Garbage: 782905k -> 764754k
    Leak: 59938k
    Overhead: 116626k -> 108807k
    GGC runs: 605 -> 604

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 123980k -> 122228k
    Peak memory use before GGC: 114589k -> 113443k
    Peak memory use after GGC: 102112k -> 100490k
    Maximum of released memory in single GGC run: 21319k -> 21377k
    Garbage: 843704k -> 824034k
    Leak: 61121k
    Overhead: 124900k -> 116463k
    GGC runs: 609 -> 607

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-06-16 05:20:30.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-06-16 10:34:02.000000000 +0000
@@ -1,5 +1,21 @@
 2005-06-16  Jan Hubicka  <jh@suse.cz>
 
+	* basic-block.h (rtl_bb_info): Break out head_, end_,
+	global_live_at_start, global_live_at_end from ...
+	(basic_block_def): ... here; update all references
+	(BB_RTL): New flag.
+	(init_rtl_bb_info): Declare.
+	* cfgexpand.c (expand_gimple_basic_block): Init bb info, set BB_RTL
+	flag.
+	* cfgrtl.c: Include ggc.h
+	(create_basic_block_structure): Init bb info.
+	(rtl_verify_flow_info_1): Check BB_RTL flag and rtl_bb_info pointer.
+	(init_rtl_bb_info): New function.
+	(rtl_merge_block, cfglayout_merge_block): Copy global_live_at_end here.
+	* cfghooks.c (merge_block): Do not copy global_live_at_end here.
+	* cfg.c (clear_bb_flags): Skip BB_RTL flag.
+	(dump_flow_info): Gueard global_live_* dumping.
+
 	* Makefile.in (cfg.o): Add new dependencies.
 	* basic-block.h (reorder_block_def): Kill
 	original/copy/duplicated/copy_number fields.


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]