GCC Bugzilla – Bug 15320
[3.4/3.5? Regression] Excessive memory consumption
Last modified: 2004-10-30 21:11:40 UTC
I work on an LGPL VHDL front-end and code generator called savant. It is
implemented in C++. We've been using g++-3.3 as our primary compiler for
the last few months. With the annoucement of version 3.4 I have installed
g++-3.4 to experiment with. (I run Debian Gnu/Linux, and I compiled the
experimental packages on my "woody" box.) Overall I have found it to be
faster, more strict, and other good things so I was planning on moving to
On one of our branches I noticed a problem. Several files that compile
using "normal" amounts of memory - not in excess of 400M of virtual memory
- require more than 2G of virtual memory to compile with g++ 3.4. These
source files do include a large and complex class heirarchy - one of the
classes is a factory for example, so it #includes a large number of files.
But 2G seems indicative of a problem.
Can you provide the preprocessed source?
Created attachment 6239 [details]
(One) file causing excessive memory consumption reported in 15320
Here is the command line used for compilation:
g++-3.4 -DHAVE_CONFIG_H -I. -I/work/dmartin/oss/savant.andy/src/analyzer
-DGENERATE_CC_REFERENCES -I/work/dmartin/local/3.4/include -I/usr/include/pccts
-I/work/dmartin/local/3.4/include -g -Wall -ggdb3 -ggdb3 -MT scram.lo -MD -MP
-MF .deps/scram.Tpo -c /work/dmartin/oss/savant.andy/src/analyzer/scram.cc
I can confirm that this takes a huge amount of memory at -O0, with -funit-at-a-time, it seems to take
less memory but still big.
Confirmed, a regression from 3.3.
For me, this seems to take about 527MB on an i686-pc-linux-gnu system using the
tip of the 3.4 branch in CVS. Is this the file that was taking 2GB?
(I did fix a major memory overuse problem for complex class hierarchies recently.)
Subject: Re: [3.4/3.5? Regression] Excessive memory consumption
On Wed, Aug 18, 2004 at 06:47:42PM -0000, mmitchel at gcc dot gnu dot org wrote:
> ------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-08-18 18:47 -------
> For me, this seems to take about 527MB on an i686-pc-linux-gnu system using the
> tip of the 3.4 branch in CVS. Is this the file that was taking 2GB?
> (I did fix a major memory overuse problem for complex class hierarchies recently.)
Yes, this is the file that was taking that much. Will this be a 3.4.2 fix
or was it in 3.4.1?
This will be in 3.4.2.
The mainline is doing better: 453 MB.
I've closed this PR.