15320 – [3.4/3.5? Regression] Excessive memory consumption (original) (raw)
Description Dale Martin 2004-05-06 15:29:31 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 it.
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.
Comment 1 Drea Pinski 2004-05-06 15:33:46 UTC
Can you provide the preprocessed source?
Comment 2 Dale Martin 2004-05-06 15:43:50 UTC
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 -I../../src -I/work/dmartin/oss/savant.andy/src -I/work/dmartin/oss/savant.andy/src/aire -I/work/dmartin/oss/savant.andy/src/aire/iir/visitor -I/work/dmartin/oss/savant.andy/src/aire/iir/IIR -I/work/dmartin/oss/savant.andy/src/aire/iir/IIRBase -I/work/dmartin/oss/savant.andy/src/aire/iir/IIRScram -I/work/dmartin/oss/savant.andy/src/visitors/module -I/work/dmartin/oss/savant.andy/src/util -I/work/dmartin/oss/savant.andy/src/analyzer -DDEVELOPER_ASSERTIONS -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 -fPIC -DPIC
Comment 3 Drea Pinski 2004-05-06 16:36:36 UTC
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.
Comment 4 Giovanni Bajo 2004-05-15 00:24:42 UTC
Confirmed, a regression from 3.3.
Comment 5 Mark Mitchell 2004-08-18 18:47:38 UTC
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.)
Comment 6 Dale Martin 2004-08-18 20:55:12 UTC
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?
Thanks! Dale
Comment 7 Mark Mitchell 2004-08-19 21:08:31 UTC
This will be in 3.4.2.
The mainline is doing better: 453 MB.
I've closed this PR.