This is the mail archive of the
gcc-regression@gcc.gnu.org
mailing list for the GCC project.
A recent patch decreased GCC's memory consumption.
- From: gcctest at suse dot de
- To: jh at suse dot cz, gcc-regression at gcc dot gnu dot org
- Date: Sat, 28 Apr 2007 09:01:53 +0000
- Subject: 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 empty function compilation at -O0 level:
Overall memory needed: 7422k -> 7491k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1952k
Maximum of released memory in single GGC run: 311k
Garbage: 447k
Leak: 2285k
Overhead: 456k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 7438k -> 7507k
Peak memory use before GGC: 2290k
Peak memory use after GGC: 1979k
Maximum of released memory in single GGC run: 311k
Garbage: 449k
Leak: 2318k
Overhead: 461k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 7518k -> 7527k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1952k
Maximum of released memory in single GGC run: 311k
Garbage: 452k
Leak: 2288k
Overhead: 457k
GGC runs: 4
comparing empty function compilation at -O2 level:
Overall memory needed: 7526k -> 7555k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1952k
Maximum of released memory in single GGC run: 311k
Garbage: 455k
Leak: 2288k
Overhead: 457k
GGC runs: 4
comparing empty function compilation at -O3 level:
Overall memory needed: 7526k -> 7555k
Peak memory use before GGC: 2263k
Peak memory use after GGC: 1952k
Maximum of released memory in single GGC run: 311k
Garbage: 455k
Leak: 2288k
Overhead: 457k
GGC runs: 4
comparing combine.c compilation at -O0 level:
Overall memory needed: 22634k -> 22651k
Peak memory use before GGC: 9308k
Peak memory use after GGC: 8827k
Maximum of released memory in single GGC run: 2622k
Garbage: 37622k
Leak: 6580k
Overhead: 5250k
GGC runs: 282
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 24602k -> 24619k
Peak memory use before GGC: 11116k
Peak memory use after GGC: 10579k
Maximum of released memory in single GGC run: 2595k
Garbage: 38213k
Leak: 9473k
Overhead: 5955k
GGC runs: 271
comparing combine.c compilation at -O1 level:
Overall memory needed: 40750k -> 40555k
Peak memory use before GGC: 19322k
Peak memory use after GGC: 19127k
Maximum of released memory in single GGC run: 2134k -> 2077k
Garbage: 57414k -> 57382k
Leak: 6609k
Overhead: 6554k -> 6547k
GGC runs: 352
comparing combine.c compilation at -O2 level:
Overall memory needed: 41558k -> 41059k
Peak memory use before GGC: 19373k -> 19372k
Peak memory use after GGC: 19179k
Maximum of released memory in single GGC run: 2148k -> 2159k
Garbage: 69427k -> 69376k
Leak: 6740k -> 6732k
Overhead: 8402k -> 8392k
GGC runs: 405 -> 406
comparing combine.c compilation at -O3 level:
Overall memory needed: 45826k -> 45611k
Peak memory use before GGC: 19484k
Peak memory use after GGC: 19266k
Maximum of released memory in single GGC run: 3635k
Garbage: 90833k -> 90771k
Leak: 6843k
Overhead: 11451k -> 11439k
GGC runs: 429 -> 428
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 151886k -> 151663k
Peak memory use before GGC: 69577k
Peak memory use after GGC: 44191k
Maximum of released memory in single GGC run: 37379k
Garbage: 133641k
Leak: 9583k
Overhead: 17418k
GGC runs: 216
comparing insn-attrtab.c compilation at -O0 -g level:
Overall memory needed: 153270k -> 153171k
Peak memory use before GGC: 70739k
Peak memory use after GGC: 45459k
Maximum of released memory in single GGC run: 37380k
Garbage: 135123k
Leak: 11051k
Overhead: 17815k
GGC runs: 215
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 182738k -> 183279k
Peak memory use before GGC: 85948k
Peak memory use after GGC: 80070k
Maximum of released memory in single GGC run: 32250k
Garbage: 268873k -> 268762k
Leak: 9403k
Overhead: 28335k -> 28313k
GGC runs: 230 -> 228
comparing insn-attrtab.c compilation at -O2 level:
Ovarall memory allocated via mmap and sbrk decreased from 206862k to 200087k, overall -3.39%
Overall memory needed: 206862k -> 200087k
Peak memory use before GGC: 87235k
Peak memory use after GGC: 80140k
Maximum of released memory in single GGC run: 30048k -> 30040k
Garbage: 302427k -> 302019k
Leak: 9401k
Overhead: 33804k -> 33722k
GGC runs: 252 -> 248
comparing insn-attrtab.c compilation at -O3 level:
Ovarall memory allocated via mmap and sbrk decreased from 206846k to 200079k, overall -3.38%
Overall memory needed: 206846k -> 200079k
Peak memory use before GGC: 87249k
Peak memory use after GGC: 80154k
Maximum of released memory in single GGC run: 30110k -> 30102k
Garbage: 303110k -> 302705k
Leak: 9405k
Overhead: 34009k -> 33928k
GGC runs: 256 -> 254
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 152472k -> 152987k
Peak memory use before GGC: 90246k
Peak memory use after GGC: 89353k
Maximum of released memory in single GGC run: 17774k
Garbage: 209978k
Leak: 49217k
Overhead: 24709k
GGC runs: 412
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Overall memory needed: 174828k -> 174771k
Peak memory use before GGC: 102853k
Peak memory use after GGC: 101834k
Maximum of released memory in single GGC run: 18129k
Garbage: 216510k
Leak: 72532k
Overhead: 30605k
GGC runs: 385
comparing Gerald's testcase PR8361 compilation at -O1 level:
Overall memory needed: 150740k -> 150728k
Peak memory use before GGC: 101900k -> 101899k
Peak memory use after GGC: 100884k
Maximum of released memory in single GGC run: 17236k
Garbage: 347654k -> 347581k
Leak: 50296k
Overhead: 31218k -> 31201k
GGC runs: 531
comparing Gerald's testcase PR8361 compilation at -O2 level:
Overall memory needed: 156916k -> 155252k
Peak memory use before GGC: 102510k -> 102512k
Peak memory use after GGC: 101495k
Maximum of released memory in single GGC run: 17233k
Garbage: 378797k -> 378710k
Leak: 51032k
Overhead: 35536k -> 35520k
GGC runs: 569
comparing Gerald's testcase PR8361 compilation at -O3 level:
Overall memory needed: 158408k -> 157080k
Peak memory use before GGC: 104309k
Peak memory use after GGC: 103276k
Maximum of released memory in single GGC run: 17610k
Garbage: 397830k -> 397752k
Leak: 51318k
Overhead: 37087k -> 37071k
GGC runs: 575
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 344869k -> 344531k
Peak memory use before GGC: 80256k
Peak memory use after GGC: 57995k
Maximum of released memory in single GGC run: 43619k
Garbage: 142770k
Leak: 7421k
Overhead: 25956k
GGC runs: 74
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 345769k -> 345431k
Peak memory use before GGC: 80902k
Peak memory use after GGC: 58641k
Maximum of released memory in single GGC run: 43608k
Garbage: 143036k
Leak: 9188k
Overhead: 26452k
GGC runs: 84
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Ovarall memory allocated via mmap and sbrk decreased from 312806k to 303191k, overall -3.17%
Overall memory needed: 312806k -> 303191k
Peak memory use before GGC: 84146k
Peak memory use after GGC: 74847k
Maximum of released memory in single GGC run: 34777k
Garbage: 231156k -> 231144k
Leak: 20856k
Overhead: 33136k -> 33134k
GGC runs: 79 -> 81
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Overall memory needed: 559758k -> 559707k
Peak memory use before GGC: 79833k
Peak memory use after GGC: 74847k
Maximum of released memory in single GGC run: 33336k
Garbage: 239608k -> 239608k
Leak: 20946k
Overhead: 35480k -> 35480k
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 1156434k to 1046099k, overall -10.55%
Overall memory needed: 1156434k -> 1046099k
Peak memory use before GGC: 201851k
Peak memory use after GGC: 190309k
Maximum of released memory in single GGC run: 80846k
Garbage: 378489k -> 378489k
Leak: 46312k
Overhead: 51551k -> 51551k
GGC runs: 71 -> 72
Head of the ChangeLog is:
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.