![]() ![]() Just don’t use the results as anything more than a guide. I’ve had Hotspot engineers recommend I “don’t use this” but I still think it’s a decent (albeit very blunt) tool for finding bottlenecks. -Xprof turns on a low-impact sampling profiler.I generally use this as my first tool to investigate if GC is a bottleneck for a given application. -verbose:gc logs garbage collector runs and how long they’re taking.There are also some basic flags for logging runtime information: Mac users: you’re already using Apple’s version of this feature, upon which Hotspot’s version is based. Note that -Xshare:off, -Xshare:on, -Xshare:auto set whether “Class Data Sharing” is enabled, and it’s not available on the -server VM or on 64-bit systems. This file is much faster to load then re-verifying and re-loading all the individual classes, and once in memory it’s shared by all JVMs on the system. When run as root (or whatever user you have the JVM installed as) it will dump a shared-memory file to disk containing all of the core class data. -Xshare:dump can help improve startup performance on some installations.You can also get a minor startup perf boost by setting minimum higher, since it doesn’t have to grow the heap right away. If you don’t include it, you’re specifying bytes. Use these flags like -Xmx512M, where the M stands for MB. So once you figure out the max memory your app needs, you cap it to keep rogue code from impacting other apps. Touted as a feature, Hotspot puts a cap on heap size to prevent it from blowing out your system. -Xms and -Xmx set the minimum and maximum sizes for the heap.The default VM is -client, unless you’re on 64-bit (it only has -server). Generally you get the best performance out of this setting. -server turns on the optimizing JIT along with a few other “server-class” settings.Most runs will want to tweak a few simple flags: These examples are gleaned from Headius’ blog: The basics In the last example, Ant gets to see the option -help, which ImageJ would have interpreted itself if it were passed before the double dash. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |