SmileBASIC has around 8MB of accessible heap memory. IIRC only arrays and strings occupy the heap, the rest occupies the stack, which is 128KB. So there's your lot for memory. If you need to write data out of memory, you need not write to disk immediately. Each GRP page is effectively an extra 512KB memory page. You could store in that assuming you appropriately convert your data to 2-byte colors.