This section explains about estimating the memory size of the Permanent area. Permanent area stores the classes that have been loaded.
As mentioned in 7.1.2 Configuring the memory space used in JavaVM and the JavaVM options, the memory size of the Permanent area is allocated separately from the memory size specified by the -Xmx option (Java heap).
For details about the default values, see 16.4 Default values of Java HotSpot VM options that can be specified in Cosminexus in the uCosminexus Application Server Definition Reference Guide.
The method for estimating the usage of the Permanent area is as follows:
Method of estimating the usage of the Permanent area
The memory usage in the Permanent area is almost the total size of the class files loaded in the J2EE server. In case of Application Server, you can perform estimations on the basis of the sum of following class file size:
- All the class files under WEB-INF/classes
- All the class files included in the JAR files under WEB-INF/lib
- All the class files generated as a result of JSP compilation
- All the class files included in EJB-JAR
- If container extension library, library JAR, and reference library are being used, then all the class files included in the JAR files that are added
- Class files created by containers
Permanent-areas-after-starting-application - Permanent-areas-before-registering-application. To perform this calculation, you must actually start the J2EE server and check the permanent areas.
- Class files (system class files) provided in Application Server
The sum of the system class files is approximately 120 MB.
- Class files provided in the JDK
The total size of the files provided in the JDK is approximately 90 MB.
Specify the memory size of the Permanent area in the -XX:MaxPermSize=size option and the -XX:PermSize=size option. For details about the default values of these options, see 16.4 Default values of Java HotSpot VM options that can be specified in Cosminexus in the uCosminexus Application Server Definition Reference Guide.
Note that the usage of the Permanent area might temporarily increase while importing the application.
- Reference note
- Resolution method when the Permanent area is compressed due to software references in the development environment
- Due to software references, the release of the Permanent area might be delayed when an application is un-deployed. Therefore, when you repeatedly deploy and un-deploy applications in the development environment, the Permanent area might be compressed due to the delay in the release of the Permanent area. Specify the following option to resolve the compression of the Permanent area due to software references:
- -XX:SoftRefLRUPolicyMSPerMB=0
- If you specify 0 in the -XX:SoftRefLRUPolicyMSPerMB option, all software references are disabled. A software reference is often used as a cache for performance improvement, so the performance of an application might deteriorate due to the specification of this option. Therefore, specify this option only when the Permanent area is compressed in the development environment.