This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa PATCH] Pick memory consumption low hanging fruit
Andrew MacLeod <amacleod@redhat.com> writes:
[snip]
> What does the memory footprint look like know when you compile with
> -fdisable-ssa... If that doesnt make much difference, you can hack at
> the SSA data structures all you want and it isnt going to affect memory
> consumption in any measurable way. If there is a 40% increase then we
> have something that needs to be fixed. I dont klnow if we've crept back
> up or not since Ive been more focused on runtime for the last few weeks
> since then.
Here is side by side comparison of gc allocated memory for the
testcase in PR8361 when using/not using the tree-ssa stuff.
It seems that tree-ssa allocates more memory, and it also keeps it
around until the end of the compilation, i.e. that memory does not
get garbage collected.
The stats where obtained with an older version of the
(unreviewed yet) patches at:
http://gcc.gnu.org/ml/gcc-patches/2003-11/msg01339.html
http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00407.html
g++ (GCC) 3.5-tree-ssa 20031115 (merged 20031111) compiled with
checking disabled, on x86-linux.
g++ -O2 PR8361.ii -fmem-report g++ -O2 -fdisable-tree-ssa PR8361.ii -fmem-report
Memory still allocated at the end of the Memory still allocated at the end of the
compilation process: compilation process:
Size Allocated Used Overhead Size Allocated Used Overhead
8 16M 16M 384k 8 3276k 3273k 73k
16 24M 24M 362k 16 5200k 5199k 76k
32 143M 143M 1583k 32 26M 5386k 291k
64 41M 41M 371k 64 11M 9414k 102k
128 2148k 2145k 16k 128 480k 476k 3840
256 25M 25M 180k 256 7828k 6679k 53k
512 27M 27M 192k 512 5412k 4605k 36k
1024 33M 33M 233k 1024 9192k 8916k 62k
2048 27M 27M 192k 2048 372k 372k 2604
4096 32M 32M 224k 4096 1068k 1068k 7476
8192 32M 32M 112k 8192 1032k 1032k 3612
16384 26M 26M 46k 16384 2560k 2560k 4480
32768 24M 24M 21k 32768 2528k 2528k 2212
65536 19M 19M 8904 65536 3264k 3264k 1428
131072 7808k 7808k 1708 131072 384k 384k 84
262144 8960k 8960k 980 262144 256k 256k 28
1048576 1024k 1024k 28
116 119M 118M 955k 116 41M 33M 332k
24 126M 126M 1523k 24 45M 18M 548k
12 41M 41M 709k 12 8252k 8242k 136k
40 95M 95M 958k 40 12M 10M 126k
Total 878M 137M 8081k Total 188M 124M 1866k
^^^^^ ^^^^
Total Memory allocated during the compilation process: Total Memory allocated during the compilation process:
Total Overhead: 156404958 Total Overhead: 44849046
Total Allocated: 918957116 Total Allocated: 507511156
^^^^^^^^^ ^^^^^^^^^
Total Overhead under 32B: 14179780 Total Overhead under 32B: 7517156
Total Allocated under 32B: 370218892 Total Allocated under 32B: 268078984
Total Overhead under 64B: 30759724 Total Overhead under 64B: 14057408
Total Allocated under 64B: 513619500 Total Allocated under 64B: 343046904
Total Overhead under 128B: 46251368 Total Overhead under 128B: 18029668
Total Allocated under 128B: 640011068 Total Allocated under 128B: 412637044
Total Overhead page size 8: 1404 Total Overhead page size 8: 1412
Total Overhead page size 32: 7908556 Total Overhead page size 32: 2852720
Total Overhead page size 64: 9359172 Total Overhead page size 64: 4298828
Total Overhead page size 128: 61364 Total Overhead page size 128: 73184
Total Overhead page size 256: 8070142 Total Overhead page size 256: 1910122
Total Overhead page size 512: 10558192 Total Overhead page size 512: 2255068
Total Overhead page size 1024: 14279356 Total Overhead page size 1024: 4038140
Total Overhead page size 2048: 12509416 Total Overhead page size 2048: 1128136
Total Overhead page size 4096: 14017628 Total Overhead page size 4096: 2253676
Total Overhead page size 8192: 14353632 Total Overhead page size 8192: 2552680
Total Overhead page size 16384: 10786948 Total Overhead page size 16384: 2686460
Total Overhead page size 32768: 11268328 Total Overhead page size 32768: 6075228
Total Overhead page size 65536: 8923096 Total Overhead page size 65536: 3709532
Total Overhead page size 131072: 2632472 Total Overhead page size 131072: 210192
Total Overhead page size 262144: 2754380 Total Overhead page size 262144: 120
Total Overhead page size 524288: 4
Total Overhead page size 1048576: 20
Total Overhead page size 116: 15430280 Total Overhead page size 116: 3899076
Total Overhead page size 24: 6269820 Total Overhead page size 24: 4663024
Total Overhead page size 40: 7220772 Total Overhead page size 40: 2241424
String pool String pool
entries 60292 entries 57447
identifiers 60292 (100.00%) identifiers 57447 (100.00%)
slots 131072 slots 131072
bytes 1154k (90k overhead) bytes 1130k (86k overhead)
table size 512k table size 512k
coll/search 0.7257 coll/search 0.7324
ins/search 0.2669 ins/search 0.2572
avg. entry 19.60 bytes (+/- 50.26) avg. entry 20.15 bytes (+/- 51.42)
longest entry 2315 longest entry 2315
??? tree nodes created ??? tree nodes created
Kind Nodes Bytes Kind Nodes Bytes
--------------------------------------- ---------------------------------------
decls 204292 23697872 decls 195909 22725444
types 35574 3272808 types 35543 3269956
blocks 110290 4852760 blocks 110290 4852760
stmts 87877 2818780 stmts 74743 2398492
refs 72221 2464184 refs 81348 2792756
exprs 2347317 80634484 exprs 1286265 42562220
constants 81012 1944152 constants 80871 1940768
identifiers 60292 3858688 identifiers 57447 3676608
perm_tree_lists 111463 2675112 perm_tree_lists 111463 2675112
temp_tree_lists 0 0 temp_tree_lists 0 0
vecs 719687 19894884 vecs 719687 19894884
phi_nodes 328644 17569872 phi_nodes 0 0
ssa names 1057763 33848416 ssa names 0 0
random kinds 1590134 38834200 random kinds 1572187 38403472
lang_decl kinds 45034 1765100 lang_decl kinds 45034 1765100
lang_type kinds 2058 139944 lang_type kinds 2058 139944
--------------------------------------- ---------------------------------------
Total 6853658 238271256 Total 4372845 147097516
--------------------------------------- ---------------------------------------
Type hash: size 32749, 13836 elements, 1.747434 Type hash: size 32749, 13836 elements, 1.747437 collisions
collisions collisions
Hmmmm, I just tried a compilation using
-O2 -fno-tree-pre -fmem-report
The lines corresponding to the ones marked with "^^^^^^^" above are:
Total 232M 191M 2229k
^^^^^^
Total Overhead: 88276642
Total Allocated: 764615468
^^^^^^^^^
So it seems that tree-pre is doing something that keeps a lot of
memory from being gc-ed.