This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


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

"out of memory" error



I am having problems with memory allocation using
Cgywin1.1.  I complied the following code with g++ and
when ran crashes and prints "out of memory".  The same
code runs fine with Cygwinb20.  I am running on a
Windows 2000 1GHz Pentium III machine with 500MB RAM. 
I am confused as to why it crashes with Cygwin1.1 and
NOT with Cygwinb20, and why it thinks it is out of
memory when it is not even approaching the available
limit.  Is there some limit Cygwin1.1 sets on memory
usage?

#include <vector.h>

void main(void) {
        vector<int> a[100];

// Crashes at i = 33
        for(int i=0;i<150;i++) {
          cout << "i = " << i << endl;
          a[i].reserve(1000000);
        }
}

The same idea, except using a series of push_backs
instead of reserve ends in the same way.  A list with
a series of push_backs also crashes.

I appreciate any help anyone can give.

Chris


__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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