This is the mail archive of the gcc@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]

Re: (C++) High memory usage with templates



>>>>> "Joe" == Joe Buck <jbuck@synopsys.com> writes:

    >> You haven't seen anything yet: when I try to compile examples
    >> from the blitz library (http://monet.uwaterloo.ca/blitz/) I see
    >> memory usages of about 400M from cc1plus.

    Joe> Which C++ version are you using?  Early egcs versions as well
    Joe> as g++2.8.1 are particularly greedy for complex templates,
    Joe> but later versions are better.

Compiling blitz-19980903/testsuite/storage.cpp with
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
I see:

g++ -I./.. -ftemplate-depth-30 -O2 -funroll-loops -fstrict-aliasing -g -DBZ_DEBUG -g -DBZ_DEBUG  -c ./storage.cpp
g++: Internal compiler error: program cc1plus got fatal signal 11
 
and a peak memory usage as reported by top of 305M.

With 
reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.25/specs
gcc version egcs-2.92.25 19981130 (gcc2 ss-980609 experimental)
the result is the same (signal 11), but the memory usage is down
to 299M.

I haven't verified other files of the blitz library now, but I
remember having seen 400M.

-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams        Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II            Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]