Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 481274 - sys-devel/gcc-4.8.1 can use ~2GB of RAM when preprocessing (gcc-4.7.3 uses ~100MB)
Summary: sys-devel/gcc-4.8.1 can use ~2GB of RAM when preprocessing (gcc-4.7.3 uses ~1...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-16 09:57 UTC by Sergey Isachenko
Modified: 2015-10-22 14:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,5.12 KB, text/plain)
2013-08-18 12:31 UTC, Sergey Isachenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Isachenko 2013-08-16 09:57:43 UTC
Boost: =dev-libs/boost-1.53.0
botan: =dev-libs/botan-1.10.3-r1

With gcc 4.7.3:

/usr/bin/time x86_64-pc-linux-gnu-g++-4.7.3 -Ibuild/include -I./src/wrap/python -E -fPIC -ftemplate-depth-255 -W -Wall -I/usr/include/python3.2 -O2 -pipe -march=corei7-avx -mcx16 -msahf -mpclmul -mpopcnt -mavx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=corei7-avx -fmem-report -c src/wrap/python/x509.cpp -o build/python/wrap_python_x509.C

Number of expanded macros:                     1113768
Average number of tokens per macro expansion:     22

Line Table allocations during the compilation process
Number of ordinary maps used:         5779 
Ordinary map used size:                225k
Number of ordinary maps allocated:    6553 
Ordinary maps allocated size:          255k
Number of macro maps used:               0 
Macro maps used size:                    0 
Macro maps locations size:               0 
Macro maps size:                         0 
Duplicated maps locations size:          0 
Total allocated maps size:             255k
Total used maps size:                  225k

Memory still allocated at the end of the compilation process
Size   Allocated        Used    Overhead
8             72k         68k       2160 
16           144k        142k       3168 
32           628k        624k         11k
64            20k         17k        320 
128         4096         768          56 
256          112k        108k       1568 
512         1008k       1004k         13k
1024        2128k       2125k         29k
2048         548k        548k       7672 
4096         752k        752k         10k
8192         488k        488k       3416 
16384         32k         16k        112 
65536         64k          0          56 
262144        512k        512k        112 
24           408k        402k       7344 
40            92k         89k       1472 
48            20k         18k        320 
56          4096        4088          64 
72            56k         52k        784 
80          4096         800          56 
88          2268k       2240k         31k
96            24k         21k        336 
112         4096        2128          56 
120           20k         16k        280 
184           20k         15k        280 
152           68k         62k        952 
168           56k         54k        784 
160         4096         960          56 
104         4096         624          56 
288          140k        134k       1960 
136         4096         816          56 
Total       9708k       9527k        127k

String pool
entries		26057
identifiers	26057 (100.00%)
slots		65536
deleted		0
bytes		426k (17592186044415M overhead)
table size	512k
coll/search	1.0076
ins/search	0.0233
avg. entry	16.77 bytes (+/- 9.92)
longest entry	79

??? tree nodes created

(No per-node statistics)
Type hash: size 1021, 29 elements, 0.131148 collisions
DECL_DEBUG_EXPR  hash: size 1021, 0 elements, 0.000000 collisions
DECL_VALUE_EXPR  hash: size 1021, 0 elements, 0.000000 collisions
no search statistics
decl_specializations: size 61, 0 elements, 0.000000 collisions
type_specializations: size 61, 0 elements, 0.000000 collisions
No gimple statistics

Alias oracle query stats:
  refs_may_alias_p: 0 disambiguations, 0 queries
  ref_maybe_used_by_call_p: 0 disambiguations, 0 queries
  call_may_clobber_ref_p: 0 disambiguations, 0 queries

PTA query stats:
  pt_solution_includes: 0 disambiguations, 0 queries
  pt_solutions_intersect: 0 disambiguations, 0 queries
2.41user 0.03system 0:02.45elapsed 100%CPU (0avgtext+0avgdata 68384maxresident)k
0inputs+7176outputs (0major+5154minor)pagefaults 0swaps


With gcc 4.8.1:

/usr/bin/time x86_64-pc-linux-gnu-g++-4.8.1 -Ibuild/include -I./src/wrap/python -E -fPIC -ftemplate-depth-255 -W -Wall -I/usr/include/python3.2 -O2 -pipe -march=corei7-avx -mcx16 -msahf -mpclmul -mpopcnt -mavx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=corei7-avx -fmem-report -c src/wrap/python/x509.cpp -o build/python/wrap_python_x509.C

Number of expanded macros:                     1348128
Average number of tokens per macro expansion:     18

Line Table allocations during the compilation process
Number of ordinary maps used:         5782 
Ordinary map used size:                225k
Number of ordinary maps allocated:    6553 
Ordinary maps allocated size:          255k
Number of macro maps used:            1087k
Macro maps used size:                   42M
Macro maps locations size:             210M
Macro maps size:                       252M
Duplicated maps locations size:         55M
Total allocated maps size:             274M
Total used maps size:                  252M

Memory still allocated at the end of the compilation process
Size   Allocated        Used    Overhead
8           1304k       1294k         38k
16           148k        145k       3256 
32          1268k       1107k         22k
64          5348k       5346k         83k
256           15M         15M        218k
512           20M         20M        286k
1024          10M         10M        145k
2048         217M        217M       3049k
4096        3628k       3628k         49k
8192        6136k       6136k         41k
16384       1616k       1616k       5656 
32768        704k        704k       1232 
262144        512k        512k        112 
67108864         64M         64M         56 
24          2612k       2546k         45k
40           936k        915k         14k
48          8412k       8371k        131k
56          1472k       1466k         23k
72           676k        636k       9464 
80            11M         11M        158k
88          2564k       2530k         35k
96          1436k       1401k         19k
112         1508k       1480k         20k
120         2192k       2179k         29k
184         3528k       3484k         48k
128          104k        103k       1456 
152         2196k       2077k         30k
168         1172k       1132k         16k
160          576k        558k       8064 
104         3048k       3015k         41k
296         2576k       2388k         35k
136         2136k       2124k         29k
Total        396M        394M       4643k

String pool
entries		26105
identifiers	26105 (100.00%)
slots		65536
deleted		0
bytes		427k (17592186044415M overhead)
table size	512k
coll/search	1.0066
ins/search	0.0233
avg. entry	16.76 bytes (+/- 9.92)
longest entry	79
(No per-node statistics)
Type hash: size 1021, 29 elements, 0.131148 collisions
DECL_DEBUG_EXPR  hash: size 1021, 0 elements, 0.000000 collisions
DECL_VALUE_EXPR  hash: size 1021, 0 elements, 0.000000 collisions
no search statistics
decl_specializations: size 61, 0 elements, 0.000000 collisions
type_specializations: size 61, 0 elements, 0.000000 collisions
No gimple statistics
No RTX statistics

Alias oracle query stats:
  refs_may_alias_p: 0 disambiguations, 0 queries
  ref_maybe_used_by_call_p: 0 disambiguations, 0 queries
  call_may_clobber_ref_p: 0 disambiguations, 0 queries

PTA query stats:
  pt_solution_includes: 0 disambiguations, 0 queries
  pt_solutions_intersect: 0 disambiguations, 0 queries
3.97user 0.30system 0:10.39elapsed 41%CPU (0avgtext+0avgdata 1770672maxresident)k
16384inputs+7208outputs (0major+111596minor)pagefaults 0swaps
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-16 14:45:06 UTC
How is this a regression? -O2 in 4.8 enables more optimisations than -O2 in 4.7. Also, progress.
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2013-08-16 14:50:33 UTC
(In reply to Jeroen Roovers from comment #1)
> How is this a regression? -O2 in 4.8 enables more optimisations than -O2 in
> 4.7. Also, progress.

1. It's a preprocessor memory consumption (note -E option),
   not even compiler. Compiler is fine and eats ~7MBs
   (there is not much to compile in bindings)

2. (actual bug) 4.7 eats 70MBs RSS, 4.8 eats 1.7G RSS
  (topic starter was not clear about it)

  > 68384maxresident)k
  > 1770672maxresident)k

What he failed to mention is he ran -j5 on his 4GB RAM machive.
Build crashed by OOM.
Comment 3 SpanKY gentoo-dev 2013-08-17 01:56:21 UTC
"uses more memory" we don't really care about.  every gcc version fluctuates (sometimes using more, sometimes using less).  the only thing we track is excessive memory usage.  1.7GB can be considered "excessive".

what package are you actually building ?  the bug summary is pretty light on details.

also, always post `emerge --info` in your bug reports.
Comment 4 Sergey Isachenko 2013-08-18 12:31:57 UTC
Created attachment 356364 [details]
emerge --info
Comment 5 Sergey Isachenko 2013-08-18 12:33:09 UTC
>> what package are you actually building ?  the bug summary is pretty light on details.
I build botan: =dev-libs/botan-1.10.3-r1

>>also, always post `emerge --info` in your bug reports.
fixed.
Comment 6 SpanKY gentoo-dev 2015-10-22 14:09:28 UTC
gcc-4.9 is stable now, so throwing away older bugs we don't plan on doing backports for as this should be fixed w/4.9+.  please re-open if it's still an issue with 4.9.3+ though.