Standard allocation ratio for Java heap

情到浓时终转凉″ 提交于 2019-12-05 16:44:24

This is JVM-specific. On Oracle's JVMs, you can find out the heap sizes by using -XX:+PrintCommandLineFlags -XX:+PrintGCDetails:

$ java -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -version
-XX:InitialHeapSize=78820288 -XX:MaxHeapSize=1261124608 -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseCompressedOops -XX:+UseParallelGC 
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
Heap
 PSYoungGen      total 22464K, used 770K [0x000000013e820000, 0x0000000140130000, 0x0000000157970000)
  eden space 19264K, 4% used [0x000000013e820000,0x000000013e8e0b08,0x000000013faf0000)
  from space 3200K, 0% used [0x000000013fe10000,0x000000013fe10000,0x0000000140130000)
  to   space 3200K, 0% used [0x000000013faf0000,0x000000013faf0000,0x000000013fe10000)
 ParOldGen       total 51328K, used 0K [0x000000010c570000, 0x000000010f790000, 0x000000013e820000)
  object space 51328K, 0% used [0x000000010c570000,0x000000010c570000,0x000000010f790000)
 PSPermGen       total 21248K, used 2165K [0x0000000107370000, 0x0000000108830000, 0x000000010c570000)
  object space 21248K, 10% used [0x0000000107370000,0x000000010758d6a8,0x0000000108830000)

From this, you can easily work out the ratios.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!