Several possible solutions:
* Why bother with buffering the image? Since it appears not the be actively
displayed anyway, use an unbuffered image
* Since you are not displaying the image life, you can use disk space as
but beware: Access times will skyrocket, and you'll probably need to code
the disk interaction yourself.
* Do not worry about OOM until it proves to be the case. I never would have
said so a year ago, but OOM conditions arise much rarer then we'd usually
think. Don't worry about them until they actually arise. (If they already
arise, yes... then you should worry about them)
Whom the gods wish to destroy they first call promising.