What is weird though is that 2 copies of each image results in more than 2 times the memory. If I do this:
for (int i = 0; i < dir.size(); i++){
images.push_back(ofImage());
ofLoadImage(images[i], dir.getPath(i));
}
The memory goes through the roof (up to about 1.8GB before it crashes). But if I do this:
for (int i = 0; i < dir.size(); i++){
textures.push_back(ofTexture());
ofLoadImage(textures[i], dir.getPath(i));
}
The memory sticks at less than 200MB and it all works perfectly.