'std::bad_alloc' in c++ while vector.push_back()

Hi

I am using testing with 2.6.15 kernel i686, while I am running a c++
code, I get

****************************************************************
terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc

Program received signal SIGABRT, Aborted.
0xb7d487c7 in ?? ()
****************************************************************

I googled and learned that it is either exhausting what is available
or it is requesting a chunk larger than the system can provide.
I have 1GB or ram and the files I need to load in the c++ code are 5
each has 40kb which is not too much, so the ram is ok.

how can I check what per-process limits on how much memory can be
allocated. and change that or remove the limits.
does the following make sense to you and if so, what needs to be done?
thanks

**************** more info ****************

:~$ ulimit -aH
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
max nice (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) unlimited
max rt priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdb1 255912 106155 136104 44% /
tmpfs 518420 8 518412 1% /dev/shm
/dev/hdb9 9977788 312124 9158816 4% /home
/dev/hdb8 369000 8252 341088 3% /tmp
/dev/hdb5 4807056 1287008 3275864 29% /usr
/dev/hdb6 2885780 1065188 1674004 39% /var
tmpfs 10240 124 10116 2% /dev

0
Syndicate content