JAVA parameters

Document: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html

  1. 查看各种参数默认值:java -XX:+PrintFlagsFinal
  2. -Xmx: Specify the maximum size, in bytes, of the memory allocation pool. (MaxHeapSize)
    设置太小,程序一超过就会产生错误OOM:
  3. -Xms: Specify the initial size, in bytes, of the memory allocation pool. (InitialHeapSize)
    设置太大,程序一运行就会产生错误:
  4. foobar