I found a great summary of useful Java command-line options to get the best use of memory and other tuning options.
The author has a good summary syntax diagram:
Another good article on when to use the different Garbage collection settings:
I ended up using the following for my typical desktop apps:
- My laptop with only 2GB of RAM available
- -Xms768m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ParallelGCThreads=2 -XX:+UseConcMarkSweepGC
- My Quad core workstation with LOTS of memory - 16GB
- -Xms1600m -Xmx1600m -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ParallelGCThreads=4 -XX:+UseConcMarkSweepGC
- Running jEdit on my My Quad core workstation with LOTS of memory - 16GB. allows for huge memory use if needed and full GC
- -Xms1600m -Xmx5120m -XX:PermSize=128m -XX:MaxPermSize=256m -XX:ParallelGCThreads=4 -XX:+UseParallelOldGC
Different choices are needed for server applications:
The articles linked above have good discussion of server needs.