Memory utilization of cc1plus blows up compiling tFile.cc under hpux

John David Anglin dave@hiauly1.hia.nrc.ca
Wed Oct 4 14:30:00 GMT 2000


I was trying to make some progress in understanding why the performance
of cc1plus under hpux 10.20 sometimes is terrible.  It has been noted in
the past on this list that various c++ tests in the libio testsuite fail
because of timeouts.

I added "-Q -fmem-report" to try and get some statistics on what was
happening.  Initially, I just added -fmem-report and the utilization
figures printed out looked similar to those on a i686 linux system.
However, it was clear from watching the memory usage of cc1plus during
the compilation that the actual memory utilization the final values.

I have attached a log of the compilation of tFile.cc below.  Note that
the GC memory allocated balloons to 35762k during the compilation of the
second instance of void t7().  Under i686 linux, there is just one garbage
collection at this point (void t7() {GC 5325k -> 2166k}).  Thus, for
some reason the memory required to compile tFile.cc under i686 linux
is much less.

Note also that there are some very strange wall times and percentages printed
(e.g., a total wall time of -1603.-96).

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

Running ../../../../libio/testsuite/libio.tests/tFile.exp ...
Executing on host: /xxx/gnu/gcc-2.97/objdir/gcc/xgcc -B/xxx/gnu/gcc-2.97/objdir/gcc/ ../../../../libio/testsuite/../tests/tFile.cc  -ansi -D_XOPEN_SOURCE=500 -O3 -I.. -I../../../../libio/testsuite/..  -nostdinc++ -I/xxx/gnu/gcc-2.97/libstdc++ -I/xxx/gnu/gcc-2.97/libstdc++/stl -Q -fmem-report -L/xxx/gnu/gcc-2.97/objdir/hppa1.1-hp-hpux10.20//libstdc++ -L/xxx/gnu/gcc-2.97/objdir/hppa1.1-hp-hpux10.20//libiberty -L/xxx/gnu/gcc-2.97/objdir/hppa1.1-hp-hpux10.20//librx  -L/xxx/gnu/gcc-2.97/objdir/hppa1.1-hp-hpux10.20//libiberty -g  -lstdc++ -liberty -lm   -o /xxx/gnu/gcc-2.97/objdir/hppa1.1-hp-hpux10.20/libio/testsuite/tFile    (timeout = -1)
 ostream *ios::tie() const ostream *ios::tie(ostream *) short int ios::fill() const short int ios::fill(short int) __fmtflags ios::flags() const __fmtflags ios::flags(long unsigned int) int ios::precision() const int ios::precision(int) __fmtflags ios::setf(long unsigned int) __fmtflags ios::setf(long unsigned int, long unsigned int) __fmtflags ios::unsetf(long unsigned int) int ios::width() const int ios::width(int) void ios::_throw_failure() const void ios::clear(int) void ios::set(int) void ios::setstate(int) int ios::good() const int ios::eof() const int ios::fail() const int ios::bad() const int ios::rdstate() const ios::operator void *() const int ios::operator!() const int ios::exceptions() const void ios::exceptions(int) streambuf *ios::rdbuf() const streambuf *ios::rdbuf(streambuf *) void ios::sync_with_stdio() void ios::unset(state_value) ios::Init::Init() void streammarker::set_offset(int) int streammarker::saving() const void *&streambuf::_vtable() _IO_FILE *&strea!
mbuf::xchain() char *streambuf::gptr() const char *streambuf::pptr() const char *streambuf::egptr() const char *streambuf::epptr() const char *streambuf::pbase() const char *streambuf::eback() const char *streambuf::base() const char *streambuf::ebuf() const int streambuf::blen() const void streambuf::xput_char(char) int streambuf::xflags() int streambuf::xflags(int) void streambuf::xsetflags(int) void streambuf::xsetflags(int, int) void streambuf::gbump(int) void streambuf::pbump(int) void streambuf::setp(char *, char *) void streambuf::setg(char *, char *, char *) char *streambuf::shortbuf() int streambuf::in_backup() char *streambuf::Gbase() char *streambuf::eGptr() char *streambuf::Bbase() char *streambuf::Bptr() char *streambuf::eBptr() char *streambuf::Nbase() char *streambuf::eNptr() int streambuf::have_backup() int streambuf::have_markers() int streambuf::put_mode() streampos streambuf::pubseekoff(int, ios::seek_dir, int) streampos streambuf::pubseekpos(int, int) int s!
treambuf::unbuffered() int streambuf::linebuffered() void streambuf::unbuffered(int) void streambuf::linebuffered(int) int streambuf::allocate() void streambuf::allocbuf() int streambuf::in_avail() int streambuf::out_waiting() streamsize streambuf::sputn(const char *, int) streamsize streambuf::padn(char, int) streamsize streambuf::sgetn(char *, int) int streambuf::sputc(int) int streambuf::sbumpc() int streambuf::sgetc() int streambuf::snextc() void streambuf::stossc() int filebuf::is_open() const int filebuf::fd() const int filebuf::is_reading() char *filebuf::cur_ptr() char *filebuf::file_ptr() void ios::init(streambuf *, ostream *) ios::ios(streambuf *, ostream *) ios::~ios() ostream::ostream() int ostream::opfx() void ostream::osfx() ostream &ostream::put(char) ostream &ostream::put(unsigned char) ostream &ostream::put(signed char) ostream &ostream::write(const unsigned char *, int) ostream &ostream::write(const signed char *, int) ostream &ostream::write(const void *, in!
t) ostream &ostream::operator<<(unsigned char) ostream &ostream::operator<<(signed char) ostream &ostream::operator<<(const unsigned char *) ostream &ostream::operator<<(const signed char *) ostream &ostream::operator<<(short int) ostream &ostream::operator<<(short unsigned int) ostream &ostream::operator<<(bool) ostream &ostream::operator<<(float) ostream &ostream::operator<<(long double) ostream &ostream::operator<<(ostream &(*)(ostream &)) ostream &ostream::operator<<(ios &(*)(ios &)) streambuf *ostream::ostreambuf() const istream::istream() istream &istream::get(unsigned char *, int, char) istream &istream::get(unsigned char &) istream &istream::getline(unsigned char *, int, char) istream &istream::get(signed char &) istream &istream::get(signed char *, int, char) istream &istream::getline(signed char *, int, char) istream &istream::read(unsigned char *, int) istream &istream::read(signed char *, int) istream &istream::read(void *, int) int istream::ipfx(int) int istream::!
ipfx0() int istream::ipfx1() void istream::isfx() int istream::get() _G_size_t istream::gcount() istream &istream::putback(char) istream &istream::unget() istream &istream::unget(char) streambuf *istream::istreambuf() const istream &istream::operator>>(unsigned char *) istream &istream::operator>>(signed char *) istream &istream::operator>>(unsigned char &) istream &istream::operator>>(signed char &) istream &istream::operator>>(ios &(*)(ios &)) istream &istream::operator>>(istream &(*)(istream &)) iostream::iostream() istream::~istream() ostream::~ostream() _IO_istream_withassign &_IO_istream_withassign::operator=(_IO_istream_withassign &) _IO_ostream_withassign &_IO_ostream_withassign::operator=(_IO_ostream_withassign &) ios &dec(ios &) ios &hex(ios &) ios &oct(ios &) istream &WS(istream &) filebuf *fstreambase::rdbuf() const int fstreambase::is_open() const void fstreambase::setbuf(char *, int) int fstreambase::filedesc() fstreambase &fstreambase::raw() ifstream::ifstream()!
 fstreambase::~fstreambase() ifstream::ifstream(int) ifstream::ifstream(int, char *, int) ifstream::ifstream(const char *, int, int) void ifstream::open(const char *, int, int) ofstream::ofstream() ofstream::ofstream(int) ofstream::ofstream(int, char *, int) ofstream::ofstream(const char *, int, int) void ofstream::open(const char *, int, int) fstream::fstream() iostream::~iostream() fstream::fstream(int) fstream::fstream(const char *, int, int) fstream::fstream(int, char *, int) void fstream::open(const char *, int, int) strstreambuf::strstreambuf() strstreambuf::strstreambuf(int) strstreambuf::strstreambuf(void *(*)(unsigned int), void (*)(void *)) strstreambuf::strstreambuf(char *, int, char *) strstreambuf::strstreambuf(unsigned char *, int, unsigned char *) strstreambuf::strstreambuf(const char *, int) strstreambuf::strstreambuf(const unsigned char *, int) strstreambuf::strstreambuf(signed char *, int, signed char *) strstreambuf::strstreambuf(const signed char *, int) in!
t strstreambuf::frozen() void strstreambuf::freeze(int) strstreambuf *strstreambase::rdbuf() strstreambase::strstreambase() ostrstream::ostrstream() strstreambase::~strstreambase() ostrstream::ostrstream(char *, int, int) _G_ssize_t ostrstream::pcount() char *ostrstream::str() void ostrstream::freeze(int) int ostrstream::frozen() strstream::strstream() strstream::strstream(char *, int, int) _G_ssize_t strstream::pcount() char *strstream::str() void strstream::freeze(int) int strstream::frozen() SFile::SFile() fstream::~fstream() int SFile::size() int SFile::setsize(int) PlotFile::PlotFile() ofstream::~ofstream() PlotFile::PlotFile(int) PlotFile::PlotFile(const char *, int, int) int abs(int) ostream &operator<<(ostream &, record &) ostream &operator<<(ostream &, record &) void t1() void t1() void t2() void t2() void t3() ifstream::~ifstream() void t3() {GC 5747k -> 1542k} {GC 5548k -> 2169k} void t4() void t4() {GC 6258k -> 3421k} {GC 5382k -> 3808k} {GC 5383k -> 3871k} {GC 647!
3k -> 3928k} {GC 5907k -> 3965k} {GC 6437k -> 3993k} {GC 5610k -> 3121k} void t5() SFile::~SFile() void t5() void t6() PlotFile::~PlotFile() void t6() {GC 5606k -> 2071k} void t7() ostrstream::~ostrstream() istrstream::~istrstream() strstream::~strstream() void t7() {GC 5808k -> 2991k} {GC 29318k -> 19959k} {GC 26766k -> 21618k} {GC 28417k -> 22528k} {GC 29356k -> 23947k} {GC 35762k -> 11055k} {GC 15314k -> 7649k} void t8() void t8() void t9() void t9() void t10() void t10() {GC 10095k -> 3312k} {GC 5363k -> 4269k} {GC 5561k -> 4220k} void t11() void t11() void show_int(long int) void show_int(long int) void t12() void t12() int main(int, char **) int main(int, char **) {GC 5647k -> 3222k} {GC 3553k -> 1235k}
Tree                 Number            Bytes    % Total
error_mark                1              16       0.001
identifier_node        2391             149k     14.041
tree_list              2403              75k      7.056
tree_vec                246              15k      1.448
block                   505              15k      1.483
void_type                 4             512       0.047
integer_type            197              24k      2.314
real_type                 5             640       0.059
complex_type              4             512       0.047
vector_type               5             640       0.059
enumeral_type             8            1024       0.094
boolean_type              1             128       0.012
pointer_type            341              42k      4.005
reference_type           89              11k      1.045
method_type             425              53k      4.991
array_type              180              22k      2.114
record_type              84              10k      0.987
function_type           429              53k      5.038
lang_type                 2             256       0.023
integer_cst            1378              43k      4.046
string_cst                6             192       0.018
function_decl           787              98k      9.243
label_decl               49            6272       0.575
const_decl               42            5376       0.493
type_decl               242              30k      2.842
var_decl                 86              10k      1.010
parm_decl               991             123k     11.639
result_decl             225              28k      2.643
field_decl               94              11k      1.104
namespace_decl            2             256       0.023
component_ref           537              16k      1.577
indirect_ref            491              15k      1.442
array_ref                74            2368       0.217
constructor             105            3360       0.308
compound_expr            36            1152       0.106
modify_expr             255            8160       0.749
init_expr               143            4576       0.420
cond_expr                40            1280       0.117
call_expr               332              10k      0.975
plus_expr               264            8448       0.775
minus_expr               40            1280       0.117
abs_expr                  1              32       0.003
bit_ior_expr             14             448       0.041
bit_and_expr             56            1792       0.164
bit_not_expr              4             128       0.012
truth_andif_expr          6             192       0.018
truth_orif_expr           3              96       0.009
lt_expr                   3              96       0.009
ge_expr                   2              64       0.006
eq_expr                  54            1728       0.159
ne_expr                 119            3808       0.349
convert_expr             69            2208       0.203
nop_expr                984              30k      2.889
non_lvalue_expr          62            1984       0.182
save_expr                46            1472       0.135
addr_expr               503              15k      1.477
postincrement_expr         3              96       0.009
expr_stmt               383              11k      1.125
compound_stmt           304            9728       0.893
decl_stmt                49            1568       0.144
if_stmt                 154            4928       0.452
return_stmt             177            5664       0.520
label_stmt               49            1568       0.144
scope_stmt              904              28k      2.654
stmt_expr                 1              32       0.003
binding                 833              26k      2.446
overload                232            3712       0.341
subobject                72            2304       0.211
ctor_stmt                70            1120       0.103
Total                 18696            1064k

RTX                  Number            Bytes    % Total
code_label                1              64       0.146
const_int              2174              16k     39.650
const_double             21             672       1.532
pc                        1               4       0.009
reg                      18             288       0.657
mem                    1006              15k     36.695
symbol_ref             1168            9344      21.302
cc0                       1               4       0.009
Total                  4390              42k

Log    Allocated        Used    Overhead
2           4096         564         156 
3            232k         31k       5336 
4            328k         42k       4920 
5           2384k        400k         25k
6            296k        220k       2664 
7            928k        537k       7424 
8           4096        1024          28 
9           4096         512          28 
10          4096        1024          28 
Total       4188k       1235k         45k

Execution times (seconds)
 garbage collection    :  20.27 ( 3%) usr  20.26 (35%) sys 644.72 (-40%) wall
 lexical analysis      :   0.42 ( 0%) usr   0.14 ( 0%) sys   1.93 ( 0%) wall
 parser                :   4.87 ( 1%) usr   0.32 ( 1%) sys  17.20 (-1%) wall
 expand                :   1.94 ( 0%) usr   0.15 ( 0%) sys   7.35 ( 0%) wall
 varconst              :   0.02 ( 0%) usr   0.01 ( 0%) sys   0.02 ( 0%) wall
 integration           :   0.59 ( 0%) usr   0.02 ( 0%) sys   2.10 ( 0%) wall
 jump                  :  18.77 ( 3%) usr   3.07 ( 5%) sys 108.24 (-7%) wall
 CSE                   :   5.34 ( 1%) usr   0.07 ( 0%) sys  15.64 (-1%) wall
 global CSE            :  39.82 ( 7%) usr   3.39 ( 6%) sys 128.55 (-8%) wall
 loop analysis         :  29.13 ( 5%) usr   1.05 ( 2%) sys  79.13 (-5%) wall
 CSE 2                 : 298.10 (49%) usr   6.83 (12%) sys 781.11 (-49%) wall
 flow analysis         :  24.83 ( 4%) usr   3.24 ( 6%) sys  88.25 (-6%) wall
 combiner              :   8.05 ( 1%) usr   1.67 ( 3%) sys  39.29 (-2%) wall
 if-conversion         :   4.79 ( 1%) usr   0.35 ( 1%) sys  15.37 (-1%) wall
 regmove               :   3.89 ( 1%) usr   0.06 ( 0%) sys   7.54 ( 0%) wall
 scheduling            :  54.90 ( 9%) usr   7.65 (13%) sys 288.24 (-18%) wall
 local alloc           :  16.06 ( 3%) usr   2.22 ( 4%) sys 114.49 (-7%) wall
 global alloc          :   9.97 ( 2%) usr   2.38 ( 4%) sys  89.75 (-6%) wall
 reload CSE regs       :  13.37 ( 2%) usr   0.58 ( 1%) sys  40.54 (-3%) wall
 flow 2                :   6.54 ( 1%) usr   0.63 ( 1%) sys  34.31 (-2%) wall
 if-conversion 2       :   0.54 ( 0%) usr   0.02 ( 0%) sys   1.38 ( 0%) wall
 scheduling 2          :  39.76 ( 7%) usr   2.63 ( 5%) sys 137.87 (-9%) wall
 delay branch sched    :   1.68 ( 0%) usr   0.16 ( 0%) sys   5.72 ( 0%) wall
 reorder blocks        :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.14 ( 0%) wall
 shorten branches      :   0.79 ( 0%) usr   0.30 ( 1%) sys   8.79 (-1%) wall
 final                 :   1.07 ( 0%) usr   0.39 ( 1%) sys  27.04 (-2%) wall
 symout                :   0.01 ( 0%) usr   0.02 ( 0%) sys   0.29 ( 0%) wall
 rest of compilation   :   2.10 ( 0%) usr   0.04 ( 0%) sys   5.09 ( 0%) wall
 TOTAL                 : 607.74            57.77          -1603.-96

Tree                 Number            Bytes    % Total
error_mark                1              16       0.029
identifier_node         260              16k     30.312
tree_list                44            1408       2.565
void_type                 2             256       0.466
integer_type             37            4736       8.627
real_type                 3             384       0.700
complex_type              4             512       0.933
vector_type               5             640       1.166
pointer_type             13            1664       3.031
reference_type            1             128       0.233
array_type               12            1536       2.798
record_type               5             640       1.166
function_type            36            4608       8.394
integer_cst             100            3200       5.829
string_cst                2              64       0.117
function_decl            97              12k     22.617
type_decl                37            4736       8.627
var_decl                  5             640       1.166
field_decl                5             640       1.166
addr_expr                 1              32       0.058
Total                   670              53k

RTX                  Number            Bytes    % Total
code_label                1              64       0.897
const_int               154            1232      17.265
const_double             21             672       9.417
pc                        1               4       0.056
reg                      10             160       2.242
mem                     154            2464      34.529
symbol_ref              317            2536      35.538
cc0                       1               4       0.056
Total                   659            7136 

Log    Allocated        Used    Overhead
2           4096         108         156 
3           8192        5104         184 
4             16k       6896         240 
5             16k       8416         176 
6             20k         16k        180 
7             36k         32k        288 
Total        104k         69k       1224 


More information about the Gcc-bugs mailing list