码迷,mamicode.com
首页 > 编程语言 > 详细

java虚拟机的堆内存配置

时间:2017-12-14 15:46:03      阅读:46      评论:0      收藏:0      [点我收藏+]

标签:head   let   大致   官网文档   multi   his   oracle   tools   hot   

官网文档地址:https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html

接录如下:

-XX:MaxHeapSize=size

Sets the maximum size (in byes) of the memory allocation pool. This value must be a multiple of 1024 and greater than 2 MB. Append the letter k or K to indicate kilobytes, m or M to indicate megabytes, g or G to indicate gigabytes. The default value is chosen at runtime based on system configuration. For server deployments, -XX:InitialHeapSize and -XX:MaxHeapSize are often set to the same value. See the section "Ergonomics" in Java SE HotSpot Virtual Machine Garbage Collection Tuning Guide at http://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/index.html.

The following examples show how to set the maximum allowed size of allocated memory to 80 MB using various units:

-XX:MaxHeapSize=83886080
-XX:MaxHeapSize=81920k
-XX:MaxHeapSize=80m

On Oracle Solaris 7 and Oracle Solaris 8 SPARC platforms, the upper limit for this value is approximately 4,000 MB minus overhead amounts. On Oracle Solaris 2.6 and x86 platforms, the upper limit is approximately 2,000 MB minus overhead amounts. On Linux platforms, the upper limit is approximately 2,000 MB minus overhead amounts.

The -XX:MaxHeapSize option is equivalent to -Xmx.


大致是这么几点:

  1.    linux操作系统上堆内存最大的设置是2个G。
  2.    -XX:MaxHeapSize 等价于 -Xmx
  3.   这个值必须是1024的倍数并且大于2 MB

 

java虚拟机的堆内存配置

标签:head   let   大致   官网文档   multi   his   oracle   tools   hot   

原文地址:http://www.cnblogs.com/hzhuxin/p/8037879.html

(0)
(0)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
© 2014 mamicode.com 版权所有 京ICP备13008772号-2
迷上了代码!