@straceX I think I remember. I was loading multiple images into memory and I wasn't doing it in any particular order, so a bunch of small images would load first and the remaining ram would be fragmented, which made is so I couldn't load in larger images.
I had to load larger first.