I'm fetching about 136 images, each one about 500 KB, in order to have them cached on the disk.
After downloading image #98, I start getting the following error for the images left (which makes me think they aren't getting cached).
2015-07-29 09:52:44.471 MyProject[299:3418965] [HANEKE][ERROR] Failed to get data for key https://s3.amazonaws.com/my_bucket/my_image_n_99.jpg
Jul 29 09:52:45 my.host.net MyProject[299] <Error>: CGBitmapContextInfoCreate: unable to allocate 31492608 bytes for bitmap data
MyProject(299,0xb039f000) malloc: *** mach_vm_map(size=31494144) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
My first guess was the memory cache filled up, so I called HanekeSwift's Cache.onMemoryWarning()
(had to make it public
) since it has the following implementation:
for (_, (_, memoryCache, _)) in self.formats {
memoryCache.removeAllObjects()
}
But even tho I called it (and supposedly it should clear the memory cache), I still get the error, so I don't know what's wrong.
Any ideas?