During Oracle WebLogic Server Patching, we had encountered below error. java.lang.OutOfMemoryError: Java heap space
1. Review downloaded patches. Execution of this command thrown error.
./bsu.sh -view -status=downloaded -prod_dir=/u01/app/oracle/product/middleware/wlserver_10.3 -patch_download_dir=/u01/app/oracle/product/middleware/utils/bsu/cache_dir
Error:-
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.bea.plateng.common.util.io.XorInputStream.read(XorInputStream.java:38)
Exception in thread "Thread-0" Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.bea.plateng.patch.PatchSystem
at com.bea.plateng.patch.PatchClientHelper.getAllPatchDetails(PatchClientHelper.java:74)
at com.bea.plateng.patch.PatchInstallationHelper.cleanupPatchSets(PatchInstallationHelper.java:130)
at com.bea.plateng.patch.PatchTarget.<init>(PatchTarget.java:272)
at com.bea.plateng.patch.PatchTargetFactory.create(PatchTargetFactory.java:30)
at com.bea.plateng.patch.PatchTargetHelper.getPatchTargets(PatchTargetHelper.java:204)
at com.bea.plateng.patch.PatchTargetHelper.updatePatchTargets(PatchTargetHelper.java:119)
at com.bea.plateng.patch.PatchTargetHelper.getAllPatchTargets(PatchTargetHelper.java:74)
at com.bea.plateng.patch.PatchTargetHelper.getPatchTarget(PatchTargetHelper.java:247)
at com.bea.plateng.patch.Patch.getPatchTarget(Patch.java:432)
at com.bea.plateng.patch.Patch.getPatchTarget(Patch.java:416)
at com.bea.plateng.patch.Patch.main(Patch.java:251)
java.lang.OutOfMemoryError: Java heap space
at java.util.LinkedHashMap.newValueIterator(LinkedHashMap.java:397)
at java.util.HashMap$Values.iterator(HashMap.java:910)
at java.util.AbstractCollection.toArray(AbstractCollection.java:120)
at java.util.ArrayList.addAll(ArrayList.java:472)
at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.getProperties(SchemaTypeImpl.java:705)
at com.bea.cie.common.dao.xbean.XBeanDataHandler.loadPropertyMap(XBeanDataHandler.java:775)
at com.bea.cie.common.dao.xbean.XBeanDataHandler.<init>(XBeanDataHandler.java:99)
at com.bea.cie.common.dao.xbean.XBeanDataHandler.createDataHandler(XBeanDataHandler.java:559)
at com.bea.cie.common.dao.xbean.XBeanDataHandler.getComplexValue(XBeanDataHandler.java:455)
at com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getPatchDependencies(PatchCatalogHelper.java:442)
at com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getPatchDependencies(PatchCatalogHelper.java:464)
at com.bea.plateng.patch.dao.cat.PatchCatalog.getPatchDependencies(PatchCatalog.java:56)
at com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getInvalidatedPatchMap(PatchCatalogHelper.java:1621)
at com.bea.plateng.patch.PatchSystem.updatePatchCatalog(PatchSystem.java:436)
at com.bea.plateng.patch.PatchSystem.refresh(PatchSystem.java:130)
at com.bea.plateng.patch.PatchSystem.<init>(PatchSystem.java:114)
at com.bea.plateng.patch.PatchSystem.<clinit>(PatchSystem.java:41)
at com.bea.plateng.patch.PatchClientHelper.getAllPatchDetails(PatchClientHelper.java:74)
at com.bea.plateng.patch.PatchInstallationHelper.cleanupPatchSets(PatchInstallationHelper.java:130)
at com.bea.plateng.patch.PatchTarget.<init>(PatchTarget.java:272)
at com.bea.plateng.patch.PatchTargetFactory.create(PatchTargetFactory.java:30)
at com.bea.plateng.patch.ProductAliasTarget.constructPatchTargetList(ProductAliasTarget.java:88)
at com.bea.plateng.patch.ProductAliasTarget.<init>(ProductAliasTarget.java:46)
at com.bea.plateng.patch.ProductAliasTargetHelper.getProdAliasTargetList(ProductAliasTargetHelper.java:55)
at com.bea.plateng.patch.ProductAliasTargetHelper.getAllHomeToProdAliasesTargetMap(ProductAliasTargetHelper.java:32)
at com.bea.plateng.patch.ProductAliasTargetHelper.checkProfilesInProductAliases(ProductAliasTargetHelper.java:133)
at com.bea.plateng.patch.Patch$1.run(Patch.java:376)
at java.lang.Thread.run(Thread.java:662)
2. Check the bsu.sh file to examine the java memory size.
more bsu.sh
#!/bin/sh
JAVA_HOME="/u01/app/oracle/product/middleware/jdk16/jdk"
MEM_ARGS="-Xms256m -Xmx512m"
"$JAVA_HOME/bin/java" ${MEM_ARGS} -jar patch-client.jar $*
3. Solution.
Increase memory in bsu.sh
MEM_ARGS="-Xms2048m -Xmx2048m"
4. Before update.
cat bsu.sh
#!/bin/sh
JAVA_HOME="/u01/app/oracle/product/middleware/jdk16/jdk"
MEM_ARGS="-Xms1024m -Xmx1024m"
"$JAVA_HOME/bin/java" ${MEM_ARGS} -jar patch-client.jar $*
5. After updating bsu.sh
cat bsu.sh
#!/bin/sh
JAVA_HOME="/u01/app/oracle/product/middleware/jdk16/jdk"
MEM_ARGS="-Xms2048m -Xmx2048m"
"$JAVA_HOME/bin/java" ${MEM_ARGS} -jar patch-client.jar $*
6. Now execute the script again. it must run without error.
./bsu.sh -view -status=applied -prod_dir=/u01/app/oracle/product/middleware/wlserver_10.3
ProductName: WebLogic Server
ProductVersion: 10.3 MP6
Components: WebLogic Server/Core Application Server,WebLogic Server/Admi
nistration Console,WebLogic Server/Configuration Wizard and
Upgrade Framework,WebLogic Server/Web 2.0 HTTP Pub-Sub Serve
r,WebLogic Server/WebLogic SCA,WebLogic Server/WebLogic JDBC
Drivers,WebLogic Server/Third Party JDBC Drivers,WebLogic S
erver/WebLogic Server Clients,WebLogic Server/WebLogic Web S
erver Plugins,WebLogic Server/UDDI and Xquery Support,WebLog
ic Server/Server Examples,WebLogic Server/Evaluation Databas
e,WebLogic Server/Workshop Code Completion Support
BEAHome: /u01/app/oracle/product/middleware
ProductHome: /u01/app/oracle/product/middleware/wlserver_10.3
PatchSystemDir: /u01/app/oracle/product/middleware/utils/bsu
PatchDir: /u01/app/oracle/product/middleware/patch_wls1036
Profile: Default
DownloadDir: /u01/app/oracle/product/middleware/utils/bsu/cache_dir
JavaVersion: 1.6.0_29
JavaVendor: Sun
Patch ID: SRUM (14482558)
Patch ID: 6D9T
Patch ID: NIP1 (16743810,16743790,16888501)
Patch ID: WE1X (16080294)