The full name of PermGen space is permanent Generation space, which refers to the permanent storage area of memory. This section is used to store class and meta information, and class is placed in the PermGen space area when it is loaded, unlike the heap area where instance is stored, GC (garbage Collection) PermGen space will not be cleaned during the main program run time, so if the app will load many classes, PermGen space error will likely occur.
Workaround:
Refer to Workaround:
- 1, increase MaxPerm size
- Eg:-xx:+maxpermsize=256m
- 2, these additional parameters may also is helpful in some cases.
- Eg:-xmn1228m-xx:+aggressiveheap-xms2048m-xmx2048m
- 3. Enable JVM GC Logging to analyse the issue if problem still persists by setting following parameter
- Eg:-verbose:gc-xx:+printgcdetails
My solution: You can set setdomainenv.sh in WebLogic:
Parameter mem_args= "-xms512m-xmx512m-xx:maxpermsize=512m"
Finally successfully solved!!
Among them,-xx:+aggressiveheap:
Allows the JVM to automatically optimize various parameters based on the machine's memory and CPU count, usually using the machine's maximum physical memory.
And it also produced hs_err_pid23131.log.
Description: Java applications sometimes crash for a variety of reasons, creating a java_errorpid.log-like error log.
The following information was found in the log:
Pspermgen total 65536K, used 65535K [0x6e0c0000, 0x720c0000, 0x720c0000)
Object Space 65536K, 99% used [0x6e0c0000,0x720bffc0,0x720c0000)
The above information can be seen in the crash, the JVM's permsize space is almost exhausted. Therefore, it is recommended to enlarge the values of PermSize and MaxPermSize.
Note: There are always areas where you can modify the JVM in WebLogic, and if you are unsure which files to modify, all of the JVM configuration files will be modified.
Commenv.cmd, commenv.sh, Setdomainenv.cmd, setdomainenv.sh.
Modify the mem_args= "-xms512m-xmx512m-xx:maxpermsize=512m" parameter under the corresponding Java_vendor in these four files to modify the size of the heap memory area of its JVM.
WebLogic start times wrong java.lang.OutOfMemoryError:PermGen space