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 in some cases!


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: 7416k -> 7498k
    Peak memory use before GGC: 2354k
    Peak memory use after GGC: 2019k
    Maximum of released memory in single GGC run: 335k
    Garbage: 489k -> 489k
    Leak: 2281k
    Overhead: 404k -> 404k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7436k -> 7514k
    Peak memory use before GGC: 2381k
    Peak memory use after GGC: 2046k
    Maximum of released memory in single GGC run: 335k
    Garbage: 492k -> 492k
    Leak: 2314k
    Overhead: 409k -> 409k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 7524k -> 7550k
    Peak memory use before GGC: 2354k
    Peak memory use after GGC: 2019k
    Maximum of released memory in single GGC run: 335k
    Garbage: 495k -> 495k
    Leak: 2284k
    Overhead: 405k -> 405k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 7532k -> 7566k
    Peak memory use before GGC: 2354k
    Peak memory use after GGC: 2019k
    Maximum of released memory in single GGC run: 335k
    Garbage: 498k -> 498k
    Leak: 2284k
    Overhead: 406k -> 406k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 7532k -> 7566k
    Peak memory use before GGC: 2354k
    Peak memory use after GGC: 2019k
    Maximum of released memory in single GGC run: 335k
    Garbage: 498k -> 498k
    Leak: 2284k
    Overhead: 406k -> 406k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
  Overall memory allocated via mmap and sbrk increased from 17700k to 22466k, overall 26.93%
  Amount of produced GGC garbage increased from 37673k to 38386k, overall 1.89%
  Amount of memory still referenced at the end of compilation increased from 6893k to 6901k, overall 0.12%
    Overall memory needed: 17700k -> 22466k
    Peak memory use before GGC: 9037k -> 9039k
    Peak memory use after GGC: 8277k -> 8253k
    Maximum of released memory in single GGC run: 1875k -> 1595k
    Garbage: 37673k -> 38386k
    Leak: 6893k -> 6901k
    Overhead: 4637k -> 4872k
    GGC runs: 278 -> 280

comparing combine.c compilation at -O0 -g level:
  Overall memory allocated via mmap and sbrk increased from 19592k to 24390k, overall 24.49%
  Peak amount of GGC memory still allocated after garbage collecting increased from 9992k to 10008k, overall 0.16%
  Amount of produced GGC garbage increased from 38014k to 38743k, overall 1.92%
    Overall memory needed: 19592k -> 24390k
    Peak memory use before GGC: 10772k -> 10776k
    Peak memory use after GGC: 9992k -> 10008k
    Maximum of released memory in single GGC run: 1558k -> 1891k
    Garbage: 38014k -> 38743k
    Leak: 9794k
    Overhead: 5343k -> 5578k
    GGC runs: 270 -> 272

comparing combine.c compilation at -O1 level:
  Overall memory allocated via mmap and sbrk increased from 29972k to 35306k, overall 17.80%
  Peak amount of GGC memory allocated before garbage collecting increased from 17725k to 17757k, overall 0.18%
  Peak amount of GGC memory still allocated after garbage collecting increased from 17521k to 17566k, overall 0.26%
  Amount of produced GGC garbage increased from 50427k to 51882k, overall 2.88%
    Overall memory needed: 29972k -> 35306k
    Peak memory use before GGC: 17725k -> 17757k
    Peak memory use after GGC: 17521k -> 17566k
    Maximum of released memory in single GGC run: 1455k -> 1347k
    Garbage: 50427k -> 51882k
    Leak: 6959k -> 6959k
    Overhead: 5671k -> 5990k
    GGC runs: 355 -> 358

comparing combine.c compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 34368k to 37162k, overall 8.13%
  Amount of produced GGC garbage increased from 67220k to 68621k, overall 2.08%
    Overall memory needed: 34368k -> 37162k
    Peak memory use before GGC: 17776k
    Peak memory use after GGC: 17580k
    Maximum of released memory in single GGC run: 1367k -> 1348k
    Garbage: 67220k -> 68621k
    Leak: 7075k -> 7075k
    Overhead: 7790k -> 8138k
    GGC runs: 415 -> 420

comparing combine.c compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 40688k to 43630k, overall 7.23%
  Peak amount of GGC memory allocated before garbage collecting increased from 17941k to 17984k, overall 0.24%
  Amount of produced GGC garbage increased from 92281k to 93953k, overall 1.81%
    Overall memory needed: 40688k -> 43630k
    Peak memory use before GGC: 17941k -> 17984k
    Peak memory use after GGC: 17725k
    Maximum of released memory in single GGC run: 3718k
    Garbage: 92281k -> 93953k
    Leak: 7199k -> 7190k
    Overhead: 11014k -> 11423k
    GGC runs: 442 -> 450

comparing insn-attrtab.c compilation at -O0 level:
  Overall memory allocated via mmap and sbrk increased from 92912k to 142086k, overall 52.93%
  Peak amount of GGC memory allocated before garbage collecting increased from 58857k to 59807k, overall 1.61%
  Amount of produced GGC garbage increased from 129136k to 131855k, overall 2.11%
    Overall memory needed: 92912k -> 142086k
    Peak memory use before GGC: 58857k -> 59807k
    Peak memory use after GGC: 33353k -> 32813k
    Maximum of released memory in single GGC run: 33674k -> 34624k
    Garbage: 129136k -> 131855k
    Leak: 9743k
    Overhead: 13776k -> 14266k
    GGC runs: 215 -> 219

comparing insn-attrtab.c compilation at -O0 -g level:
  Overall memory allocated via mmap and sbrk increased from 94172k to 143350k, overall 52.22%
  Peak amount of GGC memory allocated before garbage collecting increased from 60019k to 60969k, overall 1.58%
  Amount of produced GGC garbage increased from 129355k to 132074k, overall 2.10%
    Overall memory needed: 94172k -> 143350k
    Peak memory use before GGC: 60019k -> 60969k
    Peak memory use after GGC: 34514k -> 33974k
    Maximum of released memory in single GGC run: 33675k -> 34625k
    Garbage: 129355k -> 132074k
    Leak: 11452k
    Overhead: 14173k -> 14664k
    GGC runs: 209 -> 216

comparing insn-attrtab.c compilation at -O1 level:
  Overall memory allocated via mmap and sbrk increased from 107556k to 152678k, overall 41.95%
  Amount of produced GGC garbage increased from 211632k to 215875k, overall 2.00%
    Overall memory needed: 107556k -> 152678k
    Peak memory use before GGC: 58484k -> 58039k
    Peak memory use after GGC: 53810k
    Maximum of released memory in single GGC run: 24264k -> 23626k
    Garbage: 211632k -> 215875k
    Leak: 9630k
    Overhead: 23935k -> 24622k
    GGC runs: 242 -> 247

comparing insn-attrtab.c compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 168228k to 191002k, overall 13.54%
  Amount of produced GGC garbage increased from 246273k to 248447k, overall 0.88%
    Overall memory needed: 168228k -> 191002k
    Peak memory use before GGC: 58361k -> 57918k
    Peak memory use after GGC: 53899k
    Maximum of released memory in single GGC run: 20511k -> 21313k
    Garbage: 246273k -> 248447k
    Leak: 9619k -> 9619k
    Overhead: 29475k -> 29974k
    GGC runs: 263 -> 271

comparing insn-attrtab.c compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 180156k to 196878k, overall 9.28%
  Amount of produced GGC garbage increased from 275378k to 277575k, overall 0.80%
    Overall memory needed: 180156k -> 196878k
    Peak memory use before GGC: 69167k
    Peak memory use after GGC: 64707k
    Maximum of released memory in single GGC run: 22124k -> 22927k
    Garbage: 275378k -> 277575k
    Leak: 9629k -> 9629k
    Overhead: 31198k -> 31701k
    GGC runs: 264 -> 274

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Overall memory allocated via mmap and sbrk increased from 145875k to 153825k, overall 5.45%
  Amount of produced GGC garbage increased from 206666k to 208628k, overall 0.95%
    Overall memory needed: 145875k -> 153825k
    Peak memory use before GGC: 89184k
    Peak memory use after GGC: 88300k
    Maximum of released memory in single GGC run: 18130k
    Garbage: 206666k -> 208628k
    Leak: 51070k -> 51075k
    Overhead: 23308k -> 24095k
    GGC runs: 408 -> 410

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
  Overall memory allocated via mmap and sbrk increased from 163583k to 174169k, overall 6.47%
  Amount of produced GGC garbage increased from 212344k to 214318k, overall 0.93%
    Overall memory needed: 163583k -> 174169k
    Peak memory use before GGC: 101740k
    Peak memory use after GGC: 100733k
    Maximum of released memory in single GGC run: 18433k
    Garbage: 212344k -> 214318k
    Leak: 74379k -> 74384k
    Overhead: 29203k -> 29991k
    GGC runs: 381 -> 382

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Overall memory allocated via mmap and sbrk increased from 141620k to 150321k, overall 6.14%
  Amount of produced GGC garbage increased from 336569k to 339928k, overall 1.00%
    Overall memory needed: 141620k -> 150321k
    Peak memory use before GGC: 100479k
    Peak memory use after GGC: 99482k
    Maximum of released memory in single GGC run: 17444k
    Garbage: 336569k -> 339928k
    Leak: 51668k -> 51659k
    Overhead: 30235k -> 31026k
    GGC runs: 526 -> 528

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 146568k to 157237k, overall 7.28%
  Amount of produced GGC garbage increased from 384500k to 387661k, overall 0.82%
    Overall memory needed: 146568k -> 157237k
    Peak memory use before GGC: 100747k -> 100744k
    Peak memory use after GGC: 99746k
    Maximum of released memory in single GGC run: 17444k
    Garbage: 384500k -> 387661k
    Leak: 52369k -> 52369k
    Overhead: 35811k -> 36613k
    GGC runs: 575 -> 580

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 148652k to 159505k, overall 7.30%
  Amount of produced GGC garbage increased from 416970k to 420006k, overall 0.73%
    Overall memory needed: 148652k -> 159505k
    Peak memory use before GGC: 102439k -> 102445k
    Peak memory use after GGC: 101421k
    Maximum of released memory in single GGC run: 17899k
    Garbage: 416970k -> 420006k
    Leak: 52973k -> 52974k
    Overhead: 38295k -> 39068k
    GGC runs: 600 -> 602

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
  Overall memory allocated via mmap and sbrk increased from 287753k to 386593k, overall 34.35%
  Amount of produced GGC garbage increased from 178484k to 179454k, overall 0.54%
    Overall memory needed: 287753k -> 386593k
    Peak memory use before GGC: 103124k -> 102418k
    Peak memory use after GGC: 58778k -> 58071k
    Maximum of released memory in single GGC run: 50582k -> 50583k
    Garbage: 178484k -> 179454k
    Leak: 7631k -> 7439k
    Overhead: 29161k -> 30910k
    GGC runs: 81 -> 76

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
  Overall memory allocated via mmap and sbrk increased from 288553k to 387393k, overall 34.25%
  Amount of produced GGC garbage increased from 178589k to 179559k, overall 0.54%
    Overall memory needed: 288553k -> 387393k
    Peak memory use before GGC: 103771k -> 103064k
    Peak memory use after GGC: 59424k -> 58718k
    Maximum of released memory in single GGC run: 50583k -> 50582k
    Garbage: 178589k -> 179559k
    Leak: 9399k -> 9207k
    Overhead: 29657k -> 31406k
    GGC runs: 89 -> 84

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
  Overall memory allocated via mmap and sbrk increased from 243840k to 306614k, overall 25.74%
  Amount of produced GGC garbage increased from 223016k to 232577k, overall 4.29%
    Overall memory needed: 243840k -> 306614k
    Peak memory use before GGC: 83520k -> 83382k
    Peak memory use after GGC: 74918k
    Maximum of released memory in single GGC run: 39402k
    Garbage: 223016k -> 232577k
    Leak: 20874k
    Overhead: 29035k -> 31739k
    GGC runs: 81

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 264624k to 319334k, overall 20.67%
  Amount of produced GGC garbage increased from 229684k to 240437k, overall 4.68%
    Overall memory needed: 264624k -> 319334k
    Peak memory use before GGC: 79905k
    Peak memory use after GGC: 74919k
    Maximum of released memory in single GGC run: 33018k -> 33014k
    Garbage: 229684k -> 240437k
    Leak: 20964k -> 20953k
    Overhead: 31054k -> 33974k
    GGC runs: 91 -> 92

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Ovarall memory allocated via mmap and sbrk decreased from 1293736k to 1031406k, overall -25.43%
  Amount of produced GGC garbage increased from 342931k to 348765k, overall 1.70%
    Overall memory needed: 1293736k -> 1031406k
    Peak memory use before GGC: 183659k
    Peak memory use after GGC: 171174k
    Maximum of released memory in single GGC run: 80650k -> 80733k
    Garbage: 342931k -> 348765k
    Leak: 46331k -> 46332k
    Overhead: 42245k -> 44720k
    GGC runs: 73 -> 75

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-06-11 13:11:50.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-06-12 05:18:14.000000000 +0000
@@ -1,3 +1,43 @@
+2007-06-11  Diego Novillo  <dnovillo@google.com>
+
+	* Makefile.in (reload1.o-warn): Remove.
+
+2007-06-11  Seongbae Park <seongbae.park@gmail.com>
+
+	* combine.c (subst): Use reg_overlap_mentioned_p
+	instead of comparing register numbers directly.
+
+2007-06-11  Kenneth Zadeck <zadeck@naturalbridge.com>
+
+	* reload1.c (mark_home_live_1): Use the mode parameter.
+
+2007-06-11  Kenneth Zadeck <zadeck@naturalbridge.com>
+
+	* df-scan.c (df_insn_delete, df_insn_rescan, df_insn_rescan_all,
+	df_process_deferred_rescans, df_notes_rescan): Fixed spelling of
+	word "deferred".
+	* df-core.c: Ditto.
+	
+2007-06-11  Daniel Berlin  <dberlin@dberlin.org>
+
+	* Merge dataflow-branch into mainline (see ChangeLog.dataflow)
+
+2007-06-11  Uros Bizjak  <ubizjak@gmail.com>
+
+	* config/i386/i386.md ("*movtf_internal): Penalize moves to and
+	from integer registers.
+	(FP mode splitters): Handle TFmode.
+
+2007-06-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+	* tree-ssa-structalias.c (find_what_p_points_to): Return false
+	for ref-all pointers that point-to anything.
+
+2007-06-11  Joseph Myers  <joseph@codesourcery.com>
+
+	* config/arm/arm.c (arm_output_dwarf_dtprel,
+	TARGET_ASM_OUTPUT_DWARF_DTPREL): New.
+
 2007-06-11  Bernd Schmidt  <bernd.schmidt@analog.com>
 
 	* config/bfin/bfin.md (movdi_insn, movsi_insn, movv2hi_insn,


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]