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: 8333k
    Peak memory use before GGC: 3396k -> 3397k
    Peak memory use after GGC: 3043k -> 3044k
    Maximum of released memory in single GGC run: 353k
    Garbage: 525k -> 525k
    Leak: 3798k -> 3799k
    Overhead: 915k -> 915k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8349k
    Peak memory use before GGC: 3423k -> 3424k
    Peak memory use after GGC: 3071k -> 3072k
    Maximum of released memory in single GGC run: 352k
    Garbage: 527k -> 527k
    Leak: 3831k -> 3832k
    Overhead: 919k -> 919k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 8385k
    Peak memory use before GGC: 3396k -> 3397k
    Peak memory use after GGC: 3043k -> 3044k
    Maximum of released memory in single GGC run: 353k
    Garbage: 527k -> 527k
    Leak: 3799k -> 3800k
    Overhead: 915k -> 915k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 8393k
    Peak memory use before GGC: 3396k -> 3397k
    Peak memory use after GGC: 3044k -> 3045k
    Maximum of released memory in single GGC run: 352k
    Garbage: 531k -> 531k
    Leak: 3800k -> 3801k
    Overhead: 916k -> 916k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 8393k
    Peak memory use before GGC: 3396k -> 3397k
    Peak memory use after GGC: 3044k -> 3045k
    Maximum of released memory in single GGC run: 352k
    Garbage: 531k -> 531k
    Leak: 3800k -> 3801k
    Overhead: 916k -> 916k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23753k -> 23757k
    Peak memory use before GGC: 10323k -> 10324k
    Peak memory use after GGC: 9567k -> 9568k
    Maximum of released memory in single GGC run: 1903k -> 1902k
    Garbage: 39067k -> 39090k
    Leak: 8856k -> 8858k
    Overhead: 5786k -> 5786k
    GGC runs: 254

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 25621k
    Peak memory use before GGC: 11984k -> 11985k
    Peak memory use after GGC: 11358k -> 11359k
    Maximum of released memory in single GGC run: 1516k -> 1515k
    Garbage: 39437k -> 39449k
    Leak: 11749k -> 11742k
    Overhead: 6492k -> 6492k
    GGC runs: 250 -> 249

comparing combine.c compilation at -O1 level:
    Overall memory needed: 35737k
    Peak memory use before GGC: 18984k -> 18985k
    Peak memory use after GGC: 18794k -> 18795k
    Maximum of released memory in single GGC run: 1376k
    Garbage: 52589k -> 52593k
    Leak: 8995k -> 8996k
    Overhead: 6749k -> 6749k
    GGC runs: 322 -> 321

comparing combine.c compilation at -O2 level:
    Overall memory needed: 37749k -> 37765k
    Peak memory use before GGC: 19038k -> 19040k
    Peak memory use after GGC: 18848k -> 18851k
    Maximum of released memory in single GGC run: 1409k
    Garbage: 71026k -> 71009k
    Leak: 9327k -> 9323k
    Overhead: 8867k -> 8864k
    GGC runs: 383 -> 382

comparing combine.c compilation at -O3 level:
    Overall memory needed: 40597k -> 40513k
    Peak memory use before GGC: 19313k -> 19314k
    Peak memory use after GGC: 18965k -> 18966k
    Maximum of released memory in single GGC run: 2261k
    Garbage: 92926k -> 92895k
    Leak: 9447k -> 9432k
    Overhead: 11493k -> 11511k
    GGC runs: 412

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 140105k -> 140101k
    Peak memory use before GGC: 60580k -> 60581k
    Peak memory use after GGC: 34074k
    Maximum of released memory in single GGC run: 34143k -> 34144k
    Garbage: 132016k -> 132021k
    Leak: 11586k -> 11587k
    Overhead: 15589k -> 15589k
    GGC runs: 197

comparing insn-attrtab.c compilation at -O0 -g level:
  Amount of memory still referenced at the end of compilation increased from 13040k to 13295k, overall 1.95%
    Overall memory needed: 141361k
    Peak memory use before GGC: 61742k -> 61743k
    Peak memory use after GGC: 35235k
    Maximum of released memory in single GGC run: 34144k -> 34145k
    Garbage: 132500k -> 132249k
    Leak: 13040k -> 13295k
    Overhead: 15986k -> 15986k
    GGC runs: 199 -> 200

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 150229k -> 150221k
    Peak memory use before GGC: 59101k -> 59097k
    Peak memory use after GGC: 52850k -> 52851k
    Maximum of released memory in single GGC run: 24232k
    Garbage: 212962k -> 212964k
    Leak: 12480k -> 12481k
    Overhead: 25582k -> 25582k
    GGC runs: 222 -> 223

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 188909k -> 188933k
    Peak memory use before GGC: 59723k -> 59724k
    Peak memory use after GGC: 54429k -> 54430k
    Maximum of released memory in single GGC run: 22887k -> 22886k
    Garbage: 254073k -> 254074k
    Leak: 13562k -> 13562k
    Overhead: 31305k -> 31305k
    GGC runs: 249 -> 250

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 195881k -> 195893k
    Peak memory use before GGC: 71708k
    Peak memory use after GGC: 65141k
    Maximum of released memory in single GGC run: 23330k -> 23329k
    Garbage: 281238k -> 281239k
    Leak: 13573k -> 13573k
    Overhead: 33104k -> 33104k
    GGC runs: 252 -> 253

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 156972k -> 156980k
    Peak memory use before GGC: 91852k -> 91853k
    Peak memory use after GGC: 90943k -> 90944k
    Maximum of released memory in single GGC run: 18215k
    Garbage: 210833k -> 210837k
    Leak: 55681k -> 55682k
    Overhead: 27340k -> 27341k
    GGC runs: 394

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 177444k -> 177436k
    Peak memory use before GGC: 104643k -> 104644k
    Peak memory use after GGC: 103603k -> 103604k
    Maximum of released memory in single GGC run: 18753k
    Garbage: 216695k -> 216705k
    Leak: 79109k -> 79111k
    Overhead: 33309k -> 33309k
    GGC runs: 373

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 133387k -> 133430k
    Peak memory use before GGC: 93624k -> 93625k
    Peak memory use after GGC: 92697k -> 92698k
    Maximum of released memory in single GGC run: 17368k
    Garbage: 318345k -> 318343k
    Leak: 55570k -> 55570k
    Overhead: 33123k -> 33123k
    GGC runs: 499 -> 498

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 141791k -> 141678k
    Peak memory use before GGC: 94129k -> 94131k
    Peak memory use after GGC: 93197k -> 93199k
    Maximum of released memory in single GGC run: 17372k -> 17371k
    Garbage: 375201k -> 375260k
    Leak: 56798k -> 56798k
    Overhead: 39433k -> 39458k
    GGC runs: 558

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 145399k -> 145278k
    Peak memory use before GGC: 95152k -> 95158k
    Peak memory use after GGC: 94069k -> 94074k
    Maximum of released memory in single GGC run: 17747k
    Garbage: 416020k -> 415692k
    Leak: 57197k -> 57200k
    Overhead: 42807k -> 42762k
    GGC runs: 585

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 381012k -> 381015k
    Peak memory use before GGC: 103476k -> 103478k
    Peak memory use after GGC: 59130k -> 59131k
    Maximum of released memory in single GGC run: 50582k -> 50583k
    Garbage: 179674k -> 179674k
    Leak: 9010k -> 9011k
    Overhead: 31654k -> 31654k
    GGC runs: 65

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 381836k -> 381839k
    Peak memory use before GGC: 104123k -> 104124k
    Peak memory use after GGC: 59776k -> 59777k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179827k -> 179779k
    Leak: 10778k -> 10779k
    Overhead: 32150k -> 32150k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 290013k -> 290081k
    Peak memory use before GGC: 82784k -> 82785k
    Peak memory use after GGC: 75172k -> 75173k
    Maximum of released memory in single GGC run: 40017k
    Garbage: 236071k -> 236075k
    Leak: 18348k -> 18349k
    Overhead: 32719k -> 32720k
    GGC runs: 69

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 278237k -> 277797k
    Peak memory use before GGC: 80159k -> 80160k
    Peak memory use after GGC: 75173k -> 75174k
    Maximum of released memory in single GGC run: 33750k
    Garbage: 246134k -> 246134k
    Leak: 18437k -> 18439k
    Overhead: 34945k -> 34945k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1012273k -> 1012665k
    Peak memory use before GGC: 168800k -> 168801k
    Peak memory use after GGC: 158364k -> 158365k
    Maximum of released memory in single GGC run: 83495k
    Garbage: 356480k -> 356488k
    Leak: 28512k -> 28513k
    Overhead: 46899k -> 46900k
    GGC runs: 65

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-08-29 12:36:00.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-08-30 04:29:42.000000000 +0000
@@ -1,3 +1,35 @@
+2007-08-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* system.h: Activate -Wcast-qual as warning-only.
+
+2007-08-29  Paolo Bonzini  <bonzini@gnu.org>
+
+	PR target/33168
+	* config/rs6000/rs6000.c (compare_section_name): New function.
+	(rs6000_elf_in_small_data_p): Compare section prefixes instead
+	of full name.
+
+2007-08-29  Olivier Hainque  <hainque@adacore.com>
+
+	* xcoffout.c: #include debug.h.
+	* Makefile.in (xcoffout.o): Add debug.h dependency.
+
+2007-08-29  Uros Bizjak  <ubizjak@gmail.com>
+
+	* simplify-rtx.c (simplify_binary_operation_1) [VEC_SELECT]:
+	Change CONST_VECTOR_ELT to XVECEXP in elem calculation.
+
+2007-08-29  Richard Guenther  <rguenther@suse.de>
+
+	* tree-pretty-print.c (dump_generic_node): Print
+	label DECL_UID as D.%u.
+	* tree-dfa.c (dump_variable): Print DECL_UID as D.%u.
+
+2007-08-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+	* gcc/builtin-types.def (BT_FN_PTR_PTR_SIZE): New type.
+	* gcc/builtins.def (BUILT_IN_REALLOC): New builtin.
+
 2007-08-29  Douglas Gregor  <doug.gregor@gmail.com>
 
 	PR c++/33194


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]