Sizing the Java heap
Size your Java heap so that your application runs with a minimum heap usage of 40%, and a maximum heap usage of 70%.
Introduction
An incorrectly sized Java heap can lead to OutOfMemoryError exceptions or to a reduction in the performance of the Java application.
If the Java heap is smaller than the memory requirements of the application, OutOfMemoryError exceptions are generated because of Java heap exhaustion. If the Java heap is slightly larger than the requirements of the application, garbage collection runs very frequently and affects the performance of the application.
You must correctly size the Java heap based on the real memory usage of the Java application.
Sizing the heap based on application memory utilization
Set the maximum Java heap size, using the -Xmx command-line option, to a value that allows the application to run with 70% occupancy of the Java heap.
The Java heap occupancy often varies over time as the load applied to the application varies. For applications where occupancy varies, set the maximum Java heap size so that there is 70% occupancy at the highest point, and set the minimum heap size, using the -Xms command line option, so that the Java heap is 40% occupied at its lowest memory usage. If these values are set, the Java memory management algortihms can modify the heap size over time according to the application load, while maintaining usage in the optimal area of between 40% and 70% occupancy.
Maximum possible heap size and maximum recommended heap size (32-bit Java)
The memory space provided by the operating system to the Java process varies by operating system and is used for two separate memory areas: the Java heap and the native heap. Because a finite amount of memory is provided by the operating system, and that memory is shared between the two heaps, the larger the amount of memory that is allocated to the Java heap, using the -Xmx setting, the smaller the native heap becomes. If the native heap is too small, an OutOfMemoryError occurs when it is exhausted, in the same way as for the Java heap.
Platform |
Additional options |
Maximum heap size |
Recommended heap size limit |
Additional notes |
AIX |
None |
3.25 GB |
2.5 GB |
Maximum heap size is not required to be, but should ideally be, a multiple of 256 MB |
Linux |
None |
2 GB |
1.5 GB |
|
|
Hugemem Kernel |
3 GB |
2.5 GB |
|
Windows |
None |
1.8 GB |
1.5 GB |
|
|
/3GB |
1.8 GB |
1.8 GB |
|
The table shows both the maximum Java heap possible and a recommended limit for the maximum Java heap size setting. The use of a maximum Java heap setting up to the recommended limit is unlikely to reduce the native heap size to a point that the native heap is exhausted.
Before setting a Java heap size greater than the recommended limit, you must understand the level of usage of the native heap, to ensure that the native heap does not become exhausted.
If you are running an application that has particularly high numbers of threads or makes heavy use of Java Native Interface (JNI) code, for example, Type 2 JDBC drivers, you might experience problems relating to the native heap with smaller Java heap sizes than the recommended limit.
Maximum possible heap size and maximum recommended heap size (64-bit Java)
When running 64-bit Java, the memory space provided by the operating system to the Java process is very large. You can therefore assume that no limit is imposed on the maximum size of the Java heap because of the contention of memory resource between the Java heap and the native heap.
Java heap size and amount of physical memory available
It is important to have more physical memory than is required by all of the processes on the machine combined to prevent paging or swapping. Paging reduces the performance of the system and affects the performance of the Java memory management system.
When increasing the Java heap size, ensure that enough unused physical memory is available on the machine to cover the increase. If sufficient physical memory is not available, either install additional memory or take into account the effect on overall performance that occurs.
This requirement does not apply to operating systems running on System z.
Size your Java heap so that your application runs with a minimum heap usage of 40%, and a maximum heap usage of 70%.
原文地址:http://publib.boulder.ibm.com/infocenter/javasdk/tools/topic/com.ibm.java.doc.igaa/_1vg00014884d287-11c3fb28dae-7ff6_1001.html
分享到:
相关推荐
when you trade ,you can use it to practise your ability to trade in you work.thankds!
The gm_ID Methodology, a sizing tool for low-voltage analog CMOS Circuits--2010 [180]
Effect of the molecular weight of sizing agent on the surface of carbon fibres and interface of its composites
SAP服务器 Sizing注释 如何选择SAP服务器
SAP sizing ,quick sizer. 硬件规格预估,SAP hana。
电机、力矩、扭矩选型软件 CONTROL MOTOR SIZING安装包 东方电机安装包
css详解box-sizing.zip
Optimised for Tablets, The Panasonic Aircon Sizing Wizard.Not sure what size air conditioner you need? This is the app for you. Simply enter some basic details about your room and the app will tell ...
CSS3中的box-sizing(content-box与border-box) CSS3中的box-sizing 属性允许以特定的方式来指定盒模型,有两种方式: content-box:标准盒模型,又叫做 W3C盒模型,一般在现代浏览器中使用的都是这个盒模型 border...
SAP cProject Sizing SAP cProject Sizing
11.3.2 Create the Enterprise Java Bean 11.3.3 Build and Deploy 11.3.4 Create a New Enterprise Java Bean Function 11.4 Using the Claim Check Pattern 11.4.1 Create Interfaces 11.4.2 Create Mappings...
2-1.Additional explanations and supportive information areprovided beyond the content of the standards.The sizing equations are based on equations for predictingthe flow of compressible and ...
用于计算民航客机的起飞重量,单发推力等,画出界限线图与使用空重曲线
ElasticSearch official guide for sizing and capacity planning
box-sizing.docx
box-sizing 属性允许您以特定的方式定义匹配某个区域的特定元素。 例如,假如您需要并排放置两个带边框的框,可通过将 box-sizing 设置为 "border-box"。这可令浏览器呈现出带有指定宽度和高度的框,并把边框和内...
The sysindexes table contains all sizing, location and distribution information Any information about size of indexes or tables is stored in sysindexes. The only source of any storage location ...
A Binary Particle Swarm Optimization for Optimal Placement and Sizing of Capacitor Banks in Radial Distribution Feeders with Distorted Substation Voltages
detail document pi Sizing and Performance Tuning
EMC VxRail Sizing工具.xlsx