This is the mail archive of the gcc-bugs@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: cc1plus memory exhausted (>200Meg)


Mark-

I still have the same problem.  G++ doesn't "blow-up" when using the
egcs STL, but it does run out of memory.  Note that each instantiation
should match the appropriate vector constructor:

    %> limit datasize 200000
    %> cat foo.cc
    #include <stdlib.h>
    #include <iostream.h>
    #include <algorithm>
    #include <vector.h>

    int main()
    {
        vector<int>             int_vec(size_t(5), int(1));
        vector<vector<int> >    int_vec_vec(size_t(7), int_vec);
        vector<vector<vector<int> > > int_vec_vec_vec(size_t(9), int_vec_vec);

        cout << int_vec_vec_vec[3][3][3] << endl;
        cout << "wow" << endl;
    }
    %> g++ -Wall -fno-exceptions -O2 -o foo foo.cc -lstdc++
    foo.cc: In function `int main()':
    foo.cc:14: virtual memory exhausted
    %> 


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