The following are some of the ways of doing it
I. Setting the JVM Heap Size for OC4J processes
If you have sufficient memory available in the system, you can improve application performance by increasing the JVM heap size by specifying the following options
-XmsSIZEM -XmxSIZEM
If you know that application consistently requires a large amount of heap memory, you can improve the performance by setting the minimum size equal to the maximum heap size i.e setting
-XmsSIZEm to be equal to -XmxSIZEm
For e.g.
-Xms512m -Xmx512m specifies a JVM heap size of 512 MB
II. Setting the JVM AggressiveHeap Option for OC4J processes
In the Java Virtual Machine 1.4.2, -XX:+AggressiveHeap option is optimized for long-running, memory intensive applications. Many applications will exhibit dramatic improvement in perfomance and scalability if the -XX:+AggressiveHeap option is specified.
III. Setting the JVM Stack Size for OC4J processes
This option sets the maximum JVM stack size for C code. The default C code stack size is 512k. You can try changing the value to 128k to improve the performance of J2EE applications as shown below
-Xss128k
IV.Setting the JVM Permanent Generation Option for OC4J Processes
The MaxPermSize option defines the size of the permanent generation in the JDK. The default value is 64K. However if your applications dynamically generate and load many classes that require a larger permanent generation size, you may see java.lang.OutOfMemory errors eventhough you have plenty of memory available in the Heap. If this occurs, change the Permanent Generation Size setting as follows
-XX:MaxPermSize=SIZEm
You should pay attention to the permanent generation size while deploying large applications to the OC4J since it may contain hundreds and thousands of EJB modules which may require JVM to load large number of classes.
PermSize is in addition to the -Xmx value set by the user in JVM options.
If you were to set both the PermSize & MaxPermSize to 256 MB, you would notice that the overall heap has grown 256 MB in addition to the -Xmx setting. You could check with 'pmap' command in solaris to see the memory the resulting process is taking up.
To set the total heap size to 768 MB, set the following at OC4J startup,
java -Xms512m -Xmx512m -XX:MaxPermSize=256m
To determine the MaxPermSize property, you can use visualgc to monitor OC4J JVM during application deployment.
No comments:
Post a Comment