This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
cc1plus memory exhausted (>200Meg)
- To: egcs at cygnus dot com, egcs-bugs at cygnus dot com
- Subject: cc1plus memory exhausted (>200Meg)
- From: Fred Richardson <frichard at bbn dot com>
- Date: Wed, 8 Oct 1997 01:54:01 -0400
- Reply-to: frichard at bbn dot com
Hi!
I've applied Jason Merrill's Oct 3rd patch, but there is still a
run-away memory problem. Here's a simple STL example:
%> cat foo.cc
#include <stdlib.h>
#include <iostream.h>
#include <algorithm>
#include <vector.h>
int main()
{
vector<int> int_vec(5, 1);
vector<vector<int> > int_vec_vec(7, int_vec);
vector<vector<vector<int> > > int_vec_vec_vec(9, int_vec_vec);
cout << int_vec_vec_vec[3][3][3] << endl;
cout << "wow" << endl;
}
%> limit datasize 200000
%> g++ -Wall -fno-exceptions -O2 -o foo -I$SGI_STL_INC_DIR foo.cc -lstdc++
foo.cc: In function `int main()':
foo.cc:14: virtual memory exhausted
%>
I'm using the SGI STL here. If I use the egcs version of
the STL (which is an older version), other bad things happen:
%> g++ -Wall -fno-exceptions -O2 -o foo foo.cc -lstdc++
..../egcs/include/g++/vector.h:103: Internal compiler error 97.
..../egcs/include/g++/vector.h:103: Please submit a full bug report to `egcs-bugs@cygnus.com'.
%>
I also tried the "SGI STL Adaptation Project"'s version, but I ran
into the same problem (and then some).
If anyone has time to look into this, that would be great.
-Fred