normally i would check to see if what i tried to allocate failed with a null pointer, and display an error.
Please read this: Arduino Memories | Memories of an Arduino | Adafruit Learning System
Install 1.5.6r2 and you will have that answer every time you press the "check mark" to build.
If you are on 1.0.x then you can do a compile, go to the temp directory where the files were built, locate the .ELF file and user the AVR utility program: AVR-SIZE -C
Windows:
PATH=%path%;C:\Program Files\Arduino_105\hardware\tools\avr\utils\bin;
CD %TEMP%
MD %PUBLIC%\ELFtemp
for /R %TEMP% %%f in (*.elf) do XCOPY /D /Y %%f %PUBLIC%\ELFtemp\
DIR %PUBLIC%\ELFtemp\*.elf /s /b /O:-D /T:W >ElfRhere
SET /P ELF= <ElfRhere
ECHO %ELF% >MemUsage.txt
AVR-SIZE -C %ELF% >>MemUsage.txt
NOTEPAD MemUsage.txt
SET ELF=""
Explanations and other platforms here:
Details here: AVR SRAM Usage Script (Windows) - Exhibition / Gallery - Arduino Forum