Home‎ > ‎Tom's Ideas And Notes‎ > ‎

Summary of useful Java commandline memory use options

posted Oct 21, 2012, 10:48 AM by Tom Gutwin   [ updated Oct 21, 2012, 11:10 AM ]
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  -XX:+UseParNewGC
  • My Quad core workstation with LOTS of memory - 16GB
    • -Xms1600m -Xmx1600m -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ParallelGCThreads=4 -XX:+UseConcMarkSweepGC  -XX:+UseParNewGC

  • 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.

    Comments