4 Replies Latest reply: Oct 9, 2012 2:38 PM by 846189 RSS

    ThreadAbortedException: java.lang.OutOfMemoryError

    682459
      Hi All,

      I am writing a Batch program to upload 360K Records from flat file in one run into Staging Table. Only two methods are there in the java file. First one to validate record and Second one to create Staging records using DTO.


      In two min the Batch inserting 50000 records then the insert process slow down to 1000 records per min. After processing 65000 records the FW throws the following exception.

      1. How to increase the Heap Memory size.
      2. Is there any way to increase the Hibernate Cache memory size?

      Server logs for better understanding of the problem.

      - 20:55:03,734 [Thread-15:WorkProcessor$WorkRunner(WorkProcessor$WorkRunner:e62ce006-0642-4d0b-8f28-19416d70653f)] INFO (batch.logging.BatchLogWriter) Sending standard output to D:\\SPL\\sploutput\\INDIANA\\CMU0PIUS.20090907205503.4.THD1.stdout\par
      - 20:55:03,734 [Thread-15:WorkProcessor$WorkRunner(WorkProcessor$WorkRunner:e62ce006-0642-4d0b-8f28-19416d70653f)] INFO (batch.logging.BatchLogWriter) Sending error output to D:\\SPL\\sploutput\\INDIANA\\CMU0PIUS.20090907205503.4.THD1.stderr\par
      - 20:55:03,734 [CobolThread 1] INFO (COBOL.CIPZBJEB) JOBID=40953812677625 COMPLETED\par
      Time -- 2009-09-07-20.55.04 -- lineNumber 1000
      Time -- 2009-09-07-20.55.06 -- lineNumber 2000
      Time -- 2009-09-07-20.55.07 -- lineNumber 3000
      Time -- 2009-09-07-20.55.08 -- lineNumber 4000
      Time -- 2009-09-07-20.55.09 -- lineNumber 5000
      Time -- 2009-09-07-20.55.10 -- lineNumber 6000
      Time -- 2009-09-07-20.55.11 -- lineNumber 7000
      Time -- 2009-09-07-20.55.13 -- lineNumber 8000
      Time -- 2009-09-07-20.55.14 -- lineNumber 9000
      Time -- 2009-09-07-20.55.15 -- lineNumber 10000
      Time -- 2009-09-07-20.55.17 -- lineNumber 11000
      Time -- 2009-09-07-20.55.18 -- lineNumber 12000
      Time -- 2009-09-07-20.55.19 -- lineNumber 13000
      Time -- 2009-09-07-20.55.20 -- lineNumber 14000
      Time -- 2009-09-07-20.55.21 -- lineNumber 15000
      Time -- 2009-09-07-20.55.23 -- lineNumber 16000
      Time -- 2009-09-07-20.55.24 -- lineNumber 17000
      Time -- 2009-09-07-20.55.25 -- lineNumber 18000
      Time -- 2009-09-07-20.55.26 -- lineNumber 19000
      Time -- 2009-09-07-20.55.27 -- lineNumber 20000
      Time -- 2009-09-07-20.55.28 -- lineNumber 21000
      Time -- 2009-09-07-20.55.30 -- lineNumber 22000
      Time -- 2009-09-07-20.55.31 -- lineNumber 23000
      Time -- 2009-09-07-20.55.32 -- lineNumber 24000
      Time -- 2009-09-07-20.55.33 -- lineNumber 25000
      Time -- 2009-09-07-20.55.34 -- lineNumber 26000
      Time -- 2009-09-07-20.55.35 -- lineNumber 27000
      Time -- 2009-09-07-20.55.37 -- lineNumber 28000
      Time -- 2009-09-07-20.55.38 -- lineNumber 29000
      Time -- 2009-09-07-20.55.39 -- lineNumber 30000
      Time -- 2009-09-07-20.55.40 -- lineNumber 31000
      Time -- 2009-09-07-20.55.41 -- lineNumber 32000
      Time -- 2009-09-07-20.55.42 -- lineNumber 33000
      Time -- 2009-09-07-20.55.44 -- lineNumber 34000
      Time -- 2009-09-07-20.55.46 -- lineNumber 35000
      Time -- 2009-09-07-20.55.47 -- lineNumber 36000
      Time -- 2009-09-07-20.55.48 -- lineNumber 37000
      Time -- 2009-09-07-20.55.49 -- lineNumber 38000
      Time -- 2009-09-07-20.55.50 -- lineNumber 39000
      Time -- 2009-09-07-20.55.52 -- lineNumber 40000
      Time -- 2009-09-07-20.55.53 -- lineNumber 41000
      Time -- 2009-09-07-20.55.54 -- lineNumber 42000
      Time -- 2009-09-07-20.55.55 -- lineNumber 43000
      Time -- 2009-09-07-20.55.56 -- lineNumber 44000
      Time -- 2009-09-07-20.55.57 -- lineNumber 45000
      Time -- 2009-09-07-20.55.58 -- lineNumber 46000
      Time -- 2009-09-07-20.56.00 -- lineNumber 47000
      Time -- 2009-09-07-20.56.01 -- lineNumber 48000
      Time -- 2009-09-07-20.56.03 -- lineNumber 49000
      Time -- 2009-09-07-20.56.05 -- lineNumber 50000
      Time -- 2009-09-07-20.56.06 -- lineNumber 51000
      Time -- 2009-09-07-20.56.07 -- lineNumber 52000
      Time -- 2009-09-07-20.56.10 -- lineNumber 53000
      Time -- 2009-09-07-20.56.23 -- lineNumber 54000
      Time -- 2009-09-07-20.56.35 -- lineNumber 55000
      Time -- 2009-09-07-20.56.48 -- lineNumber 56000
      Time -- 2009-09-07-20.57.01 -- lineNumber 57000
      Time -- 2009-09-07-20.57.14 -- lineNumber 58000
      Time -- 2009-09-07-20.57.32 -- lineNumber 59000
      Time -- 2009-09-07-20.57.58 -- lineNumber 60000
      Time -- 2009-09-07-20.58.27 -- lineNumber 61000
      Time -- 2009-09-07-20.58.58 -- lineNumber 62000
      Time -- 2009-09-07-20.59.54 -- lineNumber 63000
      - 21:01:21,355 [Thread-15:WorkProcessor$WorkRunner(WorkProcessor$WorkRunner:e62ce006-0642-4d0b-8f28-19416d70653f)] ERROR (api.batch.AbstractExecutionStrategy) Thread execution aborted: BatchThreadInstance_Id(batchThreadId: [batchRunId: [batchContro\par
      lId: [CMU0PIUS], batchNumber: 170, batchRerunNumber: 0], batchThreadNumber: 1], batchInstance: 118693)\par
      com.splwg.base.api.batch.ThreadAbortedException: java.lang.OutOfMemoryError: Java heap space\par
      at com.splwg.base.api.batch.SingleTransactionStrategy.concreteExecuteWork(SingleTransactionStrategy.java:92)\par
      at com.splwg.base.api.batch.AbstractExecutionStrategy.executeWork(AbstractExecutionStrategy.java:217)\par
      at com.splwg.base.support.batch.JavaBatchWork.executeThreadWork(JavaBatchWork.java:109)\par
      at com.splwg.base.support.batch.JavaBatchWork.access$300(JavaBatchWork.java:29)\par
      at com.splwg.base.support.batch.JavaBatchWork$DoExecuteWorkInSession.doBatchWorkInSession(JavaBatchWork.java:91)\par
      at com.splwg.base.support.batch.BatchWorkInSessionExecutable.run(BatchWorkInSessionExecutable.java:56)\par
      at com.splwg.base.support.batch.JavaBatchWork.doExecuteWork(JavaBatchWork.java:50)\par
      at com.splwg.base.support.grid.AbstractGridWork.executeWork(AbstractGridWork.java:69)\par
      at com.splwg.base.support.grid.node.WorkProcessor$WorkRunner.runOutsideTransaction(WorkProcessor.java:257)\par
      at com.splwg.base.support.grid.space.AbstractTask.run(AbstractTask.java:57)\par
      at com.splwg.base.support.grid.space.ThreadPool$TaskRunner.run(ThreadPool.java:166)\par
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)\par
      at java.lang.Thread.run(Thread.java:595)\par
      Caused by: java.lang.OutOfMemoryError: Java heap space\par
      at oracle.jdbc.driver.PhysicalConnection.getCharBuffer(PhysicalConnection.java:7013)\par
      at oracle.jdbc.driver.OraclePreparedStatement.exitImplicitCacheToActive(OraclePreparedStatement.java:3242)\par
      at oracle.jdbc.driver.LRUStatementCache.searchImplicitCache(LRUStatementCache.java:404)\par
      at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3133)\par
      at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3042)\par
      at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:213)\par
      at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)\par
      at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)\par
      at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)\par
      at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)\par
      at org.hibernate.loader.Loader.doQuery(Loader.java:673)\par
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)\par
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)\par
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)\par
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)\par
      at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)\par
      at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)\par
      at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)\par
      at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)\par
      at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)\par
      at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)\par
      at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)\par
      at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)\par
      at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)\par
      at com.splwg.base.support.context.FrameworkSession.get(FrameworkSession.java:621)\par
      at com.splwg.base.support.api.AbstractBusinessEntity.validateIdOnAdd(AbstractBusinessEntity.java:208)\par
      at com.splwg.cm.domain.common.customBusinessEntity.CmParcelUploadStaging_Per.setAbstractDTOValues(CmParcelUploadStaging_Per.java:729)\par
      at com.splwg.base.support.api.JavaPersistenceStrategy.updatePersistentBackendForAdd(JavaPersistenceStrategy.java:55)\par
      at com.splwg.base.support.context.FrameworkSession.createBusinessEntity(FrameworkSession.java:938)\par
      at com.splwg.base.support.impl.AbstractDataTransferObject$1.run(AbstractDataTransferObject.java:76)\par
      at com.splwg.base.support.impl.AbstractDataTransferObject$JumpFromDTORunner.run(AbstractDataTransferObject.java:166)\par
      at com.splwg.base.support.interception.SessionInterceptionManager.notifyGenericCallStackJump(SessionInterceptionManager.java:264)\par