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: 28370k
    Peak memory use before GGC: 9293k
    Peak memory use after GGC: 8832k
    Maximum of released memory in single GGC run: 2666k
    Garbage: 36856k
    Leak: 6441k
    Overhead: 4860k
    GGC runs: 280

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40210k
    Peak memory use before GGC: 17281k
    Peak memory use after GGC: 17106k
    Maximum of released memory in single GGC run: 2382k
    Garbage: 57445k
    Leak: 6505k
    Overhead: 6200k
    GGC runs: 355

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29790k
    Peak memory use before GGC: 17277k
    Peak memory use after GGC: 17106k
    Maximum of released memory in single GGC run: 2883k
    Garbage: 76254k
    Leak: 6593k
    Overhead: 8744k
    GGC runs: 420

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28894k
    Peak memory use before GGC: 18217k
    Peak memory use after GGC: 17833k
    Maximum of released memory in single GGC run: 4104k
    Garbage: 106198k
    Leak: 6668k
    Overhead: 12303k
    GGC runs: 469

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 88230k
    Peak memory use before GGC: 69777k
    Peak memory use after GGC: 44187k
    Maximum of released memory in single GGC run: 36963k
    Garbage: 129065k
    Leak: 9501k
    Overhead: 16993k
    GGC runs: 216

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 114178k
    Peak memory use before GGC: 90363k
    Peak memory use after GGC: 83725k
    Maximum of released memory in single GGC run: 31806k
    Garbage: 277740k
    Leak: 9343k
    Overhead: 29775k
    GGC runs: 223

comparing insn-attrtab.c compilation at -O2 level:
  Ovarall memory allocated via mmap and sbrk decreased from 134058k to 129338k, overall -3.65%
    Overall memory needed: 134058k -> 129338k
    Peak memory use before GGC: 92593k
    Peak memory use after GGC: 84705k
    Maximum of released memory in single GGC run: 30380k
    Garbage: 319045k
    Leak: 9345k
    Overhead: 36716k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 115578k -> 115570k
    Peak memory use before GGC: 92618k
    Peak memory use after GGC: 84731k
    Maximum of released memory in single GGC run: 30570k
    Garbage: 319697k
    Leak: 9348k
    Overhead: 36914k
    GGC runs: 250

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119502k
    Peak memory use before GGC: 92646k
    Peak memory use after GGC: 91729k
    Maximum of released memory in single GGC run: 19299k
    Garbage: 205559k
    Leak: 47677k
    Overhead: 20816k
    GGC runs: 402

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119242k
    Peak memory use before GGC: 97832k
    Peak memory use after GGC: 95623k
    Maximum of released memory in single GGC run: 18569k
    Garbage: 444257k
    Leak: 50010k
    Overhead: 32813k
    GGC runs: 552

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119250k
    Peak memory use before GGC: 97832k
    Peak memory use after GGC: 95622k
    Maximum of released memory in single GGC run: 18570k
    Garbage: 505913k
    Leak: 50715k
    Overhead: 40462k
    GGC runs: 610

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 118938k
    Peak memory use before GGC: 97879k
    Peak memory use after GGC: 96909k
    Maximum of released memory in single GGC run: 18832k
    Garbage: 525475k
    Leak: 50292k
    Overhead: 40990k
    GGC runs: 624

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137946k
    Peak memory use before GGC: 81898k
    Peak memory use after GGC: 58777k
    Maximum of released memory in single GGC run: 45493k
    Garbage: 147195k
    Leak: 7522k
    Overhead: 25300k
    GGC runs: 83

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 424310k
    Peak memory use before GGC: 205260k
    Peak memory use after GGC: 201036k
    Maximum of released memory in single GGC run: 101716k
    Garbage: 271708k
    Leak: 47588k
    Overhead: 30829k
    GGC runs: 101

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 350966k -> 351474k
    Peak memory use before GGC: 206011k
    Peak memory use after GGC: 201787k
    Maximum of released memory in single GGC run: 108042k
    Garbage: 350433k
    Leak: 48171k
    Overhead: 46275k
    GGC runs: 108

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 535442k
    Peak memory use before GGC: 314918k
    Peak memory use after GGC: 293261k
    Maximum of released memory in single GGC run: 163448k
    Garbage: 491202k
    Leak: 65503k
    Overhead: 59091k
    GGC runs: 95

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-11-02 02:40:15.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-11-02 06:19:57.000000000 +0000
@@ -1,3 +1,9 @@
+2006-11-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	PR middle-end/29335
+	* builtins.c (do_mpfr_sincos): New.
+	(fold_builtin_1): Use it to fold builtin sincos.
+
 2006-11-01  Roger Sayle  <roger@eyesopen.com>
 
 	* config/darwin.h (CPP_SPEC): Handle -pthread, transforming


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]