I wrote a very basic progam just to see what's the maximum chunk of memory I can allocate, using zmalloc().
After quite a few fine-tuned try-and-miss attempts, I turned out that maximal size of single, monolitic peace of RAM available to program is somewhere 5.7Mb <_< and goes downwards, depending of size of your program, static variables, and stack.