I think I increased my heap size to 1 GB in NetBeans since I changed the config to look like this:
netbeans_default_options=\"-J-Xmx1g ......
You can Use the tool : Eclipse Memory Analyzer Tool http://www.eclipse.org/mat/ .
It is very useful.