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!
- **软件配置**:调整Java虚拟机(JVM)参数、优化消息处理流程等。 - **监控与分析**:定期监控系统性能指标,及时发现瓶颈所在,并进行相应的优化。 **4. 具体实践** - **缓存机制**:合理利用缓存减轻数据库负担。...
根据提供的文件信息,以下内容将详细介绍有关标题“The gm_ID Methodology, a sizing tool for low-voltage analog CMOS Circuits”中所涉及的知识点。 标题中提到的“gm_ID Methodology”是指一种用于尺寸设计的...
SAP服务器 Sizing注释 如何选择SAP服务器
SAP sizing ,quick sizer. 硬件规格预估,SAP hana。
在CSS世界中,Box Sizing属性是一个至关重要的概念,它决定了元素的尺寸计算方式,从而影响布局和设计。"css详解box-sizing.zip"这个压缩包包含了一系列关于Box Sizing的资料,包括HTML文档、图像和文本说明,帮助...
"CONTROL MOTOR SIZING"是一款专业的电机选型软件,专为工程师设计,以帮助他们在项目初期选择最适合的电机。这款软件由东方电机提供,旨在确保用户能够精确地根据负载需求和工作条件来确定电机的规格。 东方电机是...
CSS3中的box-sizing(content-box与border-box) CSS3中的box-sizing 属性允许以特定的方式来指定盒模型,有两种方式: content-box:标准盒模型,又叫做 W3C盒模型,一般在现代浏览器中使用的都是这个盒模型 border...
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 ...
在民航客机的设计过程中,"Initial Sizing3.0_总体设计起飞参数_"是一个至关重要的环节,它涉及到飞机性能计算的核心部分。这个阶段主要是对新飞机的初步尺寸设定,包括起飞重量、单发推力等多个关键参数的确定,...
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 ...
根据提供的文件信息,我们可以深入探讨"SAP cProject Sizing"这一主题的相关知识点。从文档的标题、描述以及部分内容来看,本文档主要介绍了SAP cProject Sizing的使用指南及其版权信息。下面将对这些信息进行详细...
4. **Sizing the Generations**:正确配置堆内存大小是优化JVM的关键。总堆(Total Heap)包括年轻代和老年代的大小,需要根据应用的内存消耗特性进行调整。年轻代大小的设定要考虑应用创建对象的速度,以确保避免...
The Motor Sizing Tool helps to select the appropriate motor and drive from the mechanical structure in which the motor is to be used, and from the operating patterns, mass, reduction ratio and other ...
在碳纤维及其中间体表面上使用涂层剂的作用和重要性是本研究的核心内容。首先,文章探讨了不同分子量的涂层剂对碳纤维及其复合材料性能的影响。为了进行研究,研究人员使用了三种不同分子量的涂层剂,并通过X射线光...
在网页设计中,`box-sizing` 是一个至关重要的CSS属性,它改变了元素边框和内填充对其总尺寸的影响。理解并正确使用`box-sizing`能够帮助开发者更好地控制元素的布局,避免因尺寸计算方式的不同而导致的布局混乱。...
box-sizing 属性允许您以特定的方式定义匹配某个区域的特定元素。 例如,假如您需要并排放置两个带边框的框,可通过将 box-sizing 设置为 "border-box"。这可令浏览器呈现出带有指定宽度和高度的框,并把边框和内...
GAMBIT网格加密技巧是指在GAMBIT软件中使用Sizing Functions和Boundary Layers来控制网格生成的技术。在GAMBIT中,Sizing Functions和Boundary Layers是mesh control工具,用于控制网格的增长。 Sizing Functions是...
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 ...