Xcode 32-bit ENOMEM or a red herring


I’m relatively new to OF.

My first real project involves playing some image sequences (40 in total) that are just short of 2000 frames each, in real time (in this case 25fps or faster).

In the long run i’d like to be doing some clever dynamic pre loading of frames surrounding the current frame position, but to start I thought i’d just stick a couple of hundred frames from each of the 40 sequences into memory at application launch and see how it performed.

For reasons not worth explaining I tried loading frame 80-250 of each sequence. I got as far as frame 184 of the 30th sequence before I got the following. (files are 320x240 tiffs loading into a single dimensional array of type ofImage.)

redPlayerDebug(38221,0xa08b6500) malloc: *** mmap(size=307200) failed (error code=12)  
*** error: can't allocate region  
*** set a breakpoint in malloc_error_break to debug  

A little reading suggests error code 12 means i’ve run out of memory. Can anyone confirm this for me?

I’m on a Mac Pro running 10.6.4 with 8GB RAM, so i’m certainly not running out of physical memory. I assume then that i’m running out of addressable space as the app is 32-bit?

I’d love some advice on how to proceed. I was hoping to be able to consider the idea of loading many more images than this for very fast access as i’d like to be able to push up my frame-rate and image resolution without resorting to unreasonably fast disks.

Can OF be 64-bit on OS X?

Any help much appreciated.


I’d guess it’s virtual memory fragmentation rather than running out of physical memory or you’re accessing past the end of the memory you allocated (sounds like that’s not what’s happening, but maybe?). I Can you post up some of your code where you’re loading the images, i.e. is it just as ofImage objects? I know that vmmap and heap can be useful for finding problems with the virtual memory allocation, etc

As to your second point, I think to make OF 64 bit you’d need to recompile all the libraries for 64bit and there are some other tricks to it (that last part might be wrong). For a while I know OF was trying to maintain 10.4 support so the 64bit was out, but I don’t think there’s any reason for that not to move forward now (which gives me an idea of what I might play with this weekend :slight_smile: