It would be better to use profiler or similar software for this purpose. You can begin with JVisualVM which is included in JDK or JProfiler. You can also use "Java Mission Control" (newer version of JVisualVM), which allows you to take snapshots of your memory. Add these parameters at startup of your program:
It is in the "bin" folder of your JDK 7 too, called: "jmc.exe"