I searched for this kind of error and found a lot. unfortunately no thread really helped me.

I have image files which I save in an `array` or a `vector` or what ever. 

After about 1.8 GB (~1439 Images) the error `std::bad_alloc` at memory location occurs. So I tried to declared the `array` in different ways but every time the same error occurs.

```
Image* img;
Image img[180000];
Image* img = new Image[180000]

vector<Image> img;

```

(The 180k would be 1 minute of Frames). Its not really important to record 1 minute but it would be nice to save more than ~1439 Frames. Or at least to understand why this error occurs or rather why it occurs at 1.8 GB.

Maybe someone could help or explain that to me?

PS: i use a 32bit System

---

The problem is, the time to save the images in an folder or something takes to long. Maybe I have to find a compression which allows me to save just the necessary information of the image in the array and then I can restore the frames when I am done. 

I heard that you can convert an image just in a x and a y "line" which holds all these information. But how this works is another issue. 

The answers from Mark Ingram were exactly what I needed to understand the problem. Thanks for that 

edit: oh i see i explained my problem not enough. I did`t have the Images and load them in my programm. I have a Camera which records the frame with a frequency of 50Hz so while recording i have no time to save the frames.