How to Optimize the JVM Heap - Specifying Heap Size Values
28.8 Tuning Java Virtual Machines JVMs
This section discusses how to optimize the JVM heap.28.8.1 How to Optimize the JVM Heap - Specifying Heap Size Values
The goal of tuning your heap size is to minimize the time that your JVM spends doing garbage collection while maximizing the number of clients that the Fusion Middleware stack can handle at a given time. Specifically the Java heap is where the objects of a Java program live. It is a repository for live objects, dead objects, and free memory. When an object can no longer be reached from any pointer in the running program, it is considered garbage and ready for collection. A best practice is to tune the time spent doing garbage collection to within 5 of execution time. The JVM heap size determines how often and how long the virtual machine spends collecting garbage. An acceptable rate for garbage collection is application-specific and should be adjusted after analyzing the actual time and frequency of garbage collections. If you set a large heap size, full garbage collection is slower, but it occurs less frequently. If you set your heap size in accordance with your memory needs, full garbage collection is faster, but occurs more frequently. In production environments, set the minimum heap size and the maximum heap size to the same value to prevent wasting virtual machine resources used to constantly grow and shrink the heap. Ensure that the sum of the maximum heap size of all the JVMs running on your system does not exceed the amount of available physical RAM. If this value is exceeded, the Operating System starts paging and performance degrades significantly. The virtual machine always uses more memory than the heap size. The memory required for internal virtual machine functionality, native libraries outside of the virtual machine, and permanent generation memory memory required to store classes and methods is allocated in addition to the heap size settings. To tune the JVM garbage collection options you must analyze garbage collection data and check for the frequency and type of garbage collections, the size of the memory pools, and the time spent on garbage collection. Before you configure JVM garbage collection, analyze the following data points: ■ How often is garbage collection taking place? Compare the time stamps around the garbage collection. ■ How long is a full garbage collection taking? ■ What is the heap size after each full garbage collection? If the heap is always 85 free, for example, you might set the heap size smaller. ■ Do the young generation heap sizes Sun or Nursery size Jrockit need tuning? You can manually log garbage collection and memory pool sizes using verbose garbage collection logging: Sun JVM command line options: -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps Jrockit JVM command line options: -XXverbose:gc 28-24 Developers Guide for Oracle Application Integration Architecture Foundation Pack For example, you can use the following JVM options to tune the heap: ■ If you run out of heap memory not due to a memory leak, increase -Xmx. ■ If you run out of native memory, you may need to decrease -Xmx. ■ For Sun JVM, modify -Xmn to tune the size of the heap for the young generation. ■ For Oracle JRockit, modify -Xns:nursery size to tune the size of the nursery. ■ If your AIA service instance runs on a dedicated host, set the heap size value as high as possible but make sure it does not exceed the available physical RAM. Example 28–2 shows values suggested for 32-bit Sun JVM running on 32-bit Linux on 32-bit64-bit hardware. It also assumes that the host machine has sufficient physical RAM installed and that other OS processes are not consuming a significant portion of the available memory. It is highly recommended that the production environment has 64-bit JVM running on 64-bit hardware with atleast 4 GB of memory. The following configurations are based on assumption that the environment has atleast 3 GB of memory. Table 28–2 JVM Heap Size Values JVM Parameters Recommended Value for Production Notes Initial heap size 2048 It is recommended that Initial Heap and Maximum Heap are set to the same value for the proper memory utilization and minimize major garbage collection. A small heap becomes full quickly and must be garbage collected more often. It is also prone to more fragmentation, making object allocation slower. A large heap introduces a slight overhead in garbage collection times. A heap that is larger than the available physical memory in the system must be paged out to disk, which leads to long access times or even application freezes, especially during garbage collection. In general, the extra overhead caused by a larger heap is smaller than the gains in garbage collection frequency and allocation speed, as long as the heap does not get paged to disk. Thus a good heap size setting would be a heap that is as large as possible within the available physical memory. Maximum heap size 2048 Enable J2SE 5.0 Platform Mbeans Enable Keep it enabled, so that memory and cpu real time monitoring can be done and further tuning can be done if required. -XX:PermSize 256 This setting is used to allocate memory outside of heap space to hold java classes. Note: JRockit JVM does not have this capability. -XX:MaxPermSize 256 -XX:AppendRatio 3 None Tuning Integration Flows 28-25 Example 28–7 shows sample JVM configurations for 64-bit Sun JVM running on 64-bit Linux on 64-bit hardware having 16GB RAM. Note that settings such as heap space -mx -ms , young generation MaxNewSize NewSize, permanent size MaxPermSize, ParallelGCThreads must be adjusted according to the memory and processors available in your environment. Similarly, directory paths for several of the directives listed below must be adjusted accordingly. Example 28–7 Sample JVM Configurations data id=java-options value= -d64 -server -Doc4j.jms.implementation=oracle.j2ee.jms -Dcom.sun.management.jmxremote -mx8192M -ms8192M -XX:MaxPermSize=512M -XX:MaxNewSize=2450M -XX:NewSize=2450M -Xmn2500M -XX:SurvivorRatio=6 -XX:AppendRatio=3 -verbose:gc -XX:+AggressiveOpts -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseParallelOldGC -XX:ParallelGCThreads=8 -Xloggc:exportoracleproduct10.1.3.1OracleAS_1opmnlogsj2eegc.log -Djava.security.policy=ORACLE_HOMEj2eeOC4J_SOAconfigjava2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Doc4j.userThreads=true -XX:NewSize 818 Another important heap configuration is the garbage collectors generational settings. The garbage collector optimizes collection by classifying objects by how long they live. Most of the BPEL engines objects are short lived, thus they live in the Eden space. We recommend sizing the Eden space to be 40-50 of the total maximum heap size. The following command line starts Java with a Eden sizing that is 60 of the maximum heap size. Also If you are using 2 or more than 2 CPUs and it is a non-Windows machine, it is recommended to use -XX:+ AggressiveOpts jvm flag. The -XX:+ AggressiveOpts option inspects the machine resources size of memory and number of processors and attempts to set various parameters to be optimal for long-running, memory allocation-intensive jobs. Note this flag does not affect Windows performance. In JRockit JVM, young new generation is called nursery size - and it is specified using -Xnssize -XX:MaxNewSize 818 -XX:SurvivorRatio 6 -XX:+AggressiveOpts Set in the JVM argument Table 28–2 Cont. JVM Heap Size Values JVM Parameters Recommended Value for Production Notes 28-26 Developers Guide for Oracle Application Integration Architecture Foundation Pack -Doracle.mdb.fastUndeploy=60 -Doc4j.formauth.redirect=true -Djava.net.preferIPv4Stack=true -Dorabpel.home=exportoracleproduct10.1.3.1OracleAS_1bpel -Xbootclasspathp:exportoracleproduct10.1.3.1OracleAS_1bpel liborabpel-boot.jar -Dhttp.proxySet=false -Doraesb.home=exportoracleproduct10.1.3.1OracleAS_1integrationesb -Dhttp.proxySet=false -Daia.home=exportoracleAIA28.8.1.1 Java Performance Analysis Tools
A profiler is a performance analysis tool that enables you to reveal hot spots in the application that result in either high CPU utilization or high contention for shared resources. Some common profilers are: ■ OptimizeIt Java Performance Profiler at http:www.borland.comoptimizeitoptimizeit_profilerindex.html from Borland, a performance debugging tool for Solaris and Windows ■ JProbe Profiler with Memory Debugger at http:www.quest.comjprobe, a family of products that provide the capability to detect performance bottlenecks, perform code coverage and other metrics ■ Hewlett Packard JMeter at http:www.hp.comproducts1unixjavahpjmeter, a tool for analyzing profiling information ■ VTune Performance Analyzer at http:www.intel.comsoftwareproductsvtune, a tool to identify and locate performance bottlenecks in your code ■ PerformaSure at http:www.quest.comperformasure, a tool to detect, diagnose, and resolve performance problems in multitier J2EE applications28.9 Tuning Weblogic Application Server
Parts
» Oracle Fusion Middleware Online Documentation Library
» How to Use the AIA Development Guide Introduction to Project Lifecycle Workbench
» Select a Service Type value: Requestor ABCS, Provider ABCS, Enterprise
» Use the query criteria in the Search area to locate the service solution component
» How to Set Up Environments to Enable Design-Time Harvesting
» Introduction to Bills of Material
» How to Generate a Bill of Material for an AIA Lifecycle Project
» How to View a Bill of Material for an AIA Lifecycle Project
» Introducing Project Lifecycle Workbench Seed Data
» Introduction Oracle Fusion Middleware Online Documentation Library
» Input for Deployment Plan Generator Executing Deployment Plan Generator
» Deploying New or Custom Built Artifacts
» Undeploying Services Oracle Fusion Middleware Online Documentation Library
» Understanding the ODIBOM.xml File
» Understanding the ODI Deployment Plan
» Understanding the Service Annotation Element
» Understanding the Reference Annotation Element Understanding the TransportDetails Element
» How to Annotate the Service Element in a Requester ABCS Composite
» How to Annotate the Service Element in Composite Business Process Composite
» Understanding EBS Types Working with the Enterprise Business Service Library
» Understanding Design Guidelines Understanding Design Considerations
» Creating Routing Rules Working with Message Routing
» Routing at the EBS Guidelines for EBS Routing Rules
» How to Implement Fire-and-Forget Pattern with EBS One-Way Calls Creating EBS WSDLs
» How to Implement the Request-Delayed Response Pattern with the Two One-Way Calls of the EBS
» ABCS Types Introduction to ABCS
» Defining the Role of the ABCS
» Constructing ABM Schemas Analyzing the Participating Application Integration Capabilities
» Introduction to MEPs Choosing the Appropriate MEP
» Outbound Interaction with the Application
» Using BPEL for Building ABCS
» Prerequisites Constructing an ABCS
» ABCS as a Composite Application How Many Components Need to Be Built
» How to Construct the ABCS Composite Using JDeveloper Developing the BPEL Process
» How to Create References, Services, and Components Moving Abstract Service WSDLs in MDS
» Setting Correlation for the Asynchronous Request-Delayed Response MEP
» Using the Programming Models for the Request-Delayed Response Pattern
» Create Invoking Enterprise Business Services
» Update Invoking Enterprise Business Services
» Delete Sync Invoking Enterprise Business Services
» Validate Invoking Enterprise Business Services
» Process Invoking Enterprise Business Services
» Query Invoking Enterprise Business Services
» Introduction to Enabling Requester ABCS for Extension
» Introduction to Enabling Provider ABCS for Extension
» How to Design Extensions-Aware ABCS
» Designing an ABCS Composite with Extension Defining Service at Extension Points
» How to Specify a Concrete WSDL at Deployment Time
» Interfacing with Transport Adapters
» How to Develop Transport Adapters When to Put Adapters in a Single Composite
» How to CAVS Enable the Requester ABCS Introduction to the CAVSEndpointURL Value Designation
» How to Ensure Transactions in AIA Services
» Transactions in Oracle Mediator Transactions in BPEL
» Developing ABCS to Participate in a Global Transaction How to Transaction-Enable AIA Services
» Guidelines for Versioning Versioning ABCS
» Introduction to Enterprise Business Flows
» How to Implement the EBF as a BPEL Service Overview of B2B Integration Using AIA
» B2B Support in AIA Error Handling Framework
» How to Identify the B2B Document Protocol
» How to Identify the B2B Document Type and Definition
» How to Identify the EBO, EBS, and EBM to Be Used How to Design Mappings for the B2B Document
» Introduction to a Provider B2B Connector Service How to Identify the Message Exchange Pattern
» How to Develop a B2BCS Service Contract
» How to Annotate B2B Connector Services
» How to Support Trading Partner-Specific Variants
» How to Enable Error Handling
» How to Route Based on Trading Partner B2B Preferences
» How to Test Using CAVS How to Test Using Dummy Trading Partner Endpoints
» Monitoring Using Oracle B2B Reports Monitoring Using Oracle Enterprise Manager Console
» How to Support Trading Partner-Specific Variants How to Enable Error Handling
» If an additional target is needed, click the Additional Target button on the Service
» Optionally, click the Save As button to save a service solution component request Click Finish.
» Updating SOA MDS with AIA MetaData Using MDS in AIA Content of AIA_HOMEAIAMetaData
» Working with AIA Components Content in AIA_HOMEAIAMetaData
» How to Change an Existing File How to Create a New File
» Introduction to the Tools Used
» Understanding Integration Styles with Integration Framework
» Bulk Data Processing Integration Style Choice Matrix
» Identifying the EBO Designing an Oracle AIA Integration Flow
» Enter your search criteria and click Search to execute a search for a particular
» Inbound Connectivity Outbound Connectivity
» When to Use Web Services with SOAPHTTP
» Session Management for Web Services with SOAPHTTP
» Error Handling for Web Services with SOAPHTTP
» Security for Web Services with SOAPHTTP Message Propagation Using Queues or Topics
» Ensuring Guaranteed Message Delivery When to Use JCA Adapters
» Outbound - Siebel Application Interaction with AIA Services Web Services with SOAPHTTP
» Inbound: E-Business Suite Application Interaction with AIA Services Concurrent Program Executable
» Business Event Subscription JCA Connectivity Using OAPPS Adapter
» Outbound: Oracle E-Business Suite Application Interaction with AIA Services
» Testing an Oracle AIA Integration Flow Design Guidelines
» Initial Data Loads High Volume Transactions with Xref Table Intermittent High Volume Transactions
» Using Error Handling Oracle Fusion Middleware Online Documentation Library
» Click OK to save your changes. Click the Generate and Deploy tab to deploy it on the OC4J server.
» Considerations for Creating Transformation Maps Handling Missing or Empty Elements
» How to Map an Optional Source Node to an Optional Target Node How to Load System IDs Dynamically
» Introduction to DVMs When to Use DVMs Using Cross-Referencing
» Standard Elements Introducing EBM Header Concepts
» Sender Introducing EBM Header Concepts
» Target Introducing EBM Header Concepts
» BusinessScope Introducing EBM Header Concepts
» Use Case: Request-Response Use Case: Asynchronous Process
» Use Case: Synchronous Process with Spawning Child Processes
» EBMTracking Introducing EBM Header Concepts
» Understanding Oracle BPEL Error Handling Understanding Oracle Mediator Error Handling
» What Do I Need to Know About Fault Policy Files
» How to Implement Fault Handling in BPEL Processes
» Guidelines for Defining Fault Policies
» Guidelines for BPEL Catch and Catch-All Blocks in Synchronous Request-Response
» Guidelines for Configuring Mediator for Handling Business Faults
» Overview Implementing Error Handling for the Synchronous Message Exchange Pattern
» Configuring Milestones Implementing Error Handling for the Synchronous Message Exchange Pattern
» Configuring Services Between Milestones
» Describing the EBMReference Element Describing the B2BMReference Element
» Describing the FaultNotification Element
» Introduction to Extending Fault Messages
» In the Error Extension Handler field on the Error Notifications page, enter the
» Introduction to Extending Error Handling Implementing an Error Handling Extension
» Synchronous Request-Reply Pattern: How to get Synchronous Response in AIA
» Asynchronous Fire-and-Forget Pattern AIA Message Processing Patterns
» Guaranteed Delivery Pattern: How to Ensure Guaranteed Delivery in AIA
» Service Routing Pattern: How to Route the Messages to Appropriate Service Provider in AIA
» Extending Existing Schemas in AIA
» Extending AIA Services Extending Existing Transformations in AIA
» Enabling Security for AIA Services
» Overriding Policies Using a Deployment Plan Testing Secured Services using CAVS
» Oracle AIA Recommendations for Policies
» AIA Security Configuration Properties
» Understanding the Structure for Security Context Using Attribute Names
» Interpreting Empty Element Tags in XML Instance Document
» Purging the Completed Composite Instances Syntactic Functional Validation of XML Messages
» Provide Provision for Throttling Capability Artifacts Centralization Separation of Concerns
» Adapters Inside ABCS Composite OR as Separate Composite AIA Governance
» Using BPEL as Glue, Not as a Programming Language
» Avoiding Global Variables Wherever Possible
» How to Use Baselines How to Handle Resource Saturation How to Use Proactive Monitoring
» How to Eliminate Bottlenecks
» How to Tune the Oracle Database Introducing Automatic Workload Repository
» Configuring Performance Related Database Initialization Parameters
» Tuning Redo Logs Location and Sizing Automatic Segment-Space Management ASSM
» Configuring Database Connections and Datasource Statement Caching
» Oracle Metadata Service MDS Performance Tuning
» Configuring SOA Infrastructure Properties
» Configuring BPEL Process Service Engine Properties
» Configuring BPEL Properties Inside a Composite
» Configuring Mediator Service Engine Properties
» How to Tune JMS Adapters How to Tune AQ Adapters
» Overview of AIA Error Handler Framework Purging the Completed Composite Instances
» How to Optimize the JVM Heap - Specifying Heap Size Values
» XML Naming Standards General Guidelines
» Composites Composite Business Process Enterprise Business Services
» Requester Application Business Connector Service Provider Application Business Connector Services
» DVMs DVMs and Cross References
Show more