Tune the Operating System

2-6 Oracle Fusion Middleware Performance and Tuning Guide 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. 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 Oracle JRockit, modify -Xns:nursery size to tune the size of the nursery. ■ For Sun JVM, modify -Xmn to tune the size of the heap for the young generation. If you receive java.lang.OutOfMemoryError: PermGen space errors, you may also need to increase the permanent generation space.

2.4.1.2 Selecting a Garbage Collection Scheme

Depending on which JVM you are using, you can choose from several garbage collection schemes to manage your system memory. Some garbage collection schemes are more appropriate for a given type of application. Once you have an understanding of the workload of the application and the different garbage collection algorithms utilized by the JVM, you can optimize the configuration of the garbage collection. Refer to the following links for garbage collection options for your JVM: ■ For an overview of the garbage collection schemes available with Suns HotSpot VM, see Java SE 6 HotSpot Virtual Machine Garbage Collection Tuning at http:java.sun.comjavasetechnologieshotspotgcgc_tuning_ 6.html . ■ For a comprehensive explanation of the collection schemes available, see Memory Management in the Java HotSpot™ Virtual Machine at http:java.sun.comj2sereferencewhitepapersmemorymanageme nt_whitepaper.pdf . See Also: For more information on tuning the young generation see the Young Generation section of the Java SE 6 HotSpot Virtual Machine Garbage Collection Tuning at http:java.sun.comjavasetechnologieshotspotgcg c_tuning_6.htmlgeneration_sizing.young_gen For more information on Oracle JRockit heap configurations, see Setting the Heap and Nursery Size in Diagnostics Guide at http:download.oracle.comdocscdE13188_ 01jrockitgeninfodiagnosmemman.html For the Sun java virtual machine see the Insufficient Memory section of Monitoring and Managing Java SE 6 Platform Applications at http:java.sun.comdevelopertechnicalArticlesJ2SE monitoringindex.htmlInsufficient_Memory . Out of Memory Frequently Asked Questions section at http:java.sun.comdocshotspotHotSpotFAQ.htmlgc_ oom