While in previous versions of java I needed to restart the JVM and set appropriate profiler command line option, Java 6 comes with a built in alternative. jmap which was not available for Windows distributions is now available for use. Taking a memory snapshot is a point and click task:
Take the hprof dump generated and use you favorite profiler to analyze it.
If you are only interested in a short summary of memory usage by class:
So, why was it only an almost pleasant experience ? Because you need to make sure that you are connected to the same windows session as the process you are trying to dump. If you are using terminal services make sure you use the /console command line option, otherwise jmap will not work. Beats me why..