Personally, I use my own malloc/free functions, then I can keep track of everywhere I've used memory allocation, what for, and if I ever forget to free any (all memory allocations are stored in a linked list). It also means that memory allocation failures give a bit more informative output without having to check the result code all the time.
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.