sinsin
2015-03-24 08:37:05 +08:00
以前的JRE的确默认是64M的,所以才会建议一定要配置Xmx。
现在的版本怎样,其实把下面这东东放到实际不同的环境里运行一下最能直观看出。
```
public static void main(String[] args) {
java.lang.management.MemoryUsage usage = java.lang.management.ManagementFactory.getMemoryMXBean()
.getHeapMemoryUsage();
System.out.println("Max: " + usage.getMax());
System.out.println("Init: " + usage.getInit());
System.out.println("Committed: " + usage.getCommitted());
System.out.println("Used: " + usage.getUsed());
}
```