I just realized that I could not open my favourite example recordings using the standard settings included in JMC. It seems sometimes the heuristics for the default max heap size on the 32-bit HotSpot JVM results in a relatively modest value. So, if you are seeing this a lot…
…the next step would be to try to get JMC a bit more memory. The easiest way to do this is to simply edit the jmc.ini file, which is located next to the jmc launcher in the bin folder of the JDK. It will typically look something like this:
-startup
../lib/missioncontrol/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
../lib/missioncontrol/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-vm
./javaw.exe
-vmargs
-XX:+UseG1GC
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
-Djava.net.preferIPv4Stack=true
What you would typically want next is to set the max heap and initial heap to the same, and to as much as you can possibly afford. On my tiny laptop, maybe something like a gig or so:
-startup
../lib/missioncontrol/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
../lib/missioncontrol/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-vm
./javaw.exe
-vmargs
-XX:+UseG1GC
-Xmx1024m
-Xms1024m
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
-Djava.net.preferIPv4Stack=true
[…] Note: If JMC warns you the recording is too large, see this blog post. […]
I have same issue with 64bit jdk, i can only see portion of a recording, probably because unzipped recording is 9GB for 1 hour. I have use profile setting, and probably is not the best. I tried to do a template to use, for memory optimization but it didn’t work at all. Do you know any resource for more templates, or do you have a good template for memory profiling you can share, or talk about in another post?
Great blog
Thanks for the kind words! If you have a very memory intense application, you may get quite a lot of memory allocation events. Unfortunately there is no good way of throttling back on them either (yet). In your case it does sound liked you get a whole lot of them. Either dump less data at any given time, or maybe disable them in your continuous recording and do short profiling recordings when you really need more data.
Regarding a template resource, we’ve only been out for a little over two weeks; there aren’t any template resources I’ve heard of yet. But please ask in the official JMC forum at OTN!
I should probably mention that new settings can be added by using -vmargs as argument to the jmc launcher:
jmc -vmargs -Xmx2048m -Xms2048m