'virtual memory exhausted' during compilation
Corey Kosak
kosak@cs.cmu.edu
Wed Sep 10 22:13:00 GMT 1997
I have been plagued by the same problem James Macnicol alluded to (but hadn't
yet isolated) regarding the compiler running out of virtual memory during
compilation. I have been able to create a small test case that demonstrates
the bug. Notice that the bug occurs when g++ is invoked with -O2 -Wall, but
does not occur with just -O2.
% cat vm.cc
#include <vector>
class foo_t {
public:
vector<int> v;
};
class bar_t {
public:
vector<foo_t> bar;
};
int main()
{
bar_t bar;
}
% limit datasize 128M
% g++ -v
Reading specs from /usr0/lloco/lib/gcc-lib/alpha-dec-osf3.2/egcs-2.90.06/specs
gcc version egcs-2.90.06 970907 (gcc2-970802 experimental)
% g++ -O2 -Wall vm.cc
/usr0/lloco/include/g++/alloc.h: In function `static void * __default_alloc_template<threads,inst>::allocate(long unsigned int)':
In file included from /usr0/lloco/include/g++/vector.h:32,
from /usr0/lloco/include/g++/vector:6,
from vm.cc:1:
/usr0/lloco/include/g++/alloc.h:394: warning: unused variable `class __default_alloc_template<threads,inst>::lock lock_instance'
/usr0/lloco/include/g++/alloc.h: In function `static void __default_alloc_template<threads,inst>::deallocate(void *, long unsigned int)':
/usr0/lloco/include/g++/alloc.h:417: warning: unused variable `class __default_alloc_template<threads,inst>::lock lock_instance'
vm.cc: In method `bar_t::~bar_t()':
vm.cc:15: virtual memory exhausted
% g++ -O2 vm.cc
/usr/bin/ld:
Warning: Linking some objects which contain exception information sections
and some which do not. This may cause fatal runtime exception handling
problems (last obj encountered without exceptions was /usr0/lloco/lib/libstdc++.a).
/usr/bin/ld:
Warning: Linking some objects which contain exception information sections
and some which do not. This may cause fatal runtime exception handling
problems (last obj encountered without exceptions was /usr0/lloco/lib/libstdc++.a).
%
More information about the Gcc-bugs
mailing list