2

Possible Duplicate:
Real differences between “java -server” and “java -client”?

What -XX flags does the -server option enable (if any)? I'm pretty sure it controls the heap size and also which garbage collector implementation to use. But I'm not sure if it does other things like enable certain optimizations.

Community
  • 1
  • 1
Kevin
  • 24,871
  • 19
  • 102
  • 158

1 Answers1

0

Actually -server does not affect the garbage collector and practically very few of the XX options are affected.

What it actually do: it runs much smarter compiler, known as C2. It includes a lot more optimizations (and deoptimization) and OSR (on stack replacements). It's slower and it has slower iterations profiling (1k for C1, 10k for C2).

Overall you need to know: C2 is a lot better compiler (can be a factor of 30-100%+ peak performance) but it is slower on compile time and profiling. C2 does a lot more profiling than C1 to detect fast paths. C2 does a lot, a lot more inlining and code cloning, if need be.

However, Stackoverflow is not a place for whole white paper discussion, though.

bestsss
  • 11,796
  • 3
  • 53
  • 63