oracle JVM 垃圾回收

年轻代收集器

  • Copy (enabled with -XX:+UseSerialGC)
  • PS Scavenge (enabled with -XX:+UseParallelGC)
  • ParNew (enabled with -XX:+UseParNewGC)
  • G1 Young Generation (enabled with -XX:+UseG1GC)

年老代收集器

  • MarkSweepCompact (enabled with -XX:+UseSerialGC)
  • PS MarkSweep (enabled with -XX:+UseParallelOldGC)
  • ConcurrentMarkSweep (enabled with -XX:+UseConcMarkSweepGC)
  • G1 Mixed Generation (enabled with -XX:+UseG1GC)

新旧组合

Command Options Resulting Collector Combination
-XX:+UseSerialGC young Copy and old MarkSweepCompact
-XX:+UseG1GC young G1 Young and old G1 Mixed
-XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+UseAdaptiveSizePolicy young PS Scavenge old PS MarkSweep with adaptive sizing
-XX:+UseParallelGC -XX:+UseParallelOldGC -XX:-UseAdaptiveSizePolicy young PS Scavenge old PS MarkSweep, no adaptive sizing
-XX:+UseParNewGC (deprecated in Java 8 and removed in Java 9 - for ParNew see the line below which is NOT deprecated) young ParNew old MarkSweepCompact
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC young ParNew old ConcurrentMarkSweep
-XX:+UseConcMarkSweepGC -XX:-UseParNewGC (deprecated in Java 8 and removed in Java 9) young Copy old ConcurrentMarkSweep

其他选项:

http://www.fasterj.com/articles/oraclecollectors1.shtml

你可能感兴趣的:(java编程技术)