1

I am trying to insert 1.30 GB data through ETL in oracle .But i am getting Exception in thread "pool-1-thread-1" java.lang.OutOfMemoryError: Java heap space error.This is my Exception Tree

Wed Mar 05 12:07:18 IST 2014 Starting data-source : Hua_GPRS_CS5_4.7

Wed Mar 05 12:07:18 IST 2014 Fetching Files @ ./data/huagprs/source

Processing next 20 files from ./data/huagprs/source
Processing file:        D:\workspace\TestHardNess\data\huagprs\source\LEPC18_b00326794.dat_140110.100308_7518.Z
 Exception in thread "pool-1-thread-1" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:2694)
at java.lang.String.<init>(String.java:203)
at java.lang.StringBuilder.toString(StringBuilder.java:405)
at jayu.ASCIIFormattable.byteArr2TimeStamp(ASCIIFormattable.java:173)
at hua.gprs.HuawieGPRS.getValue(HuawieGPRS.java:122)
at hua.gprs.HuawieGPRS.recordToString(HuawieGPRS.java:37)
at hua.gprs.HuawieGPRS.recordToString(HuawieGPRS.java:60)
at hua.gprs.HuawieGPRS.recordToString(HuawieGPRS.java:47)
at hua.gprs.HuawieGPRS.recordToString(HuawieGPRS.java:60)
at hua.gprs.HuawieGPRS.recordToString(HuawieGPRS.java:30)
at hua.gprs.HuawieGPRSParser.persefile(HuawieGPRSParser.java:123)
at hua.gprs.HuaGPRSFileExecutor.processFile(HuaGPRSFileExecutor.java:16)
at com.etl.FileExecutor.run(FileExecutor.java:166)
at com.etl.JobManager.executeFiles(JobManager.java:113)
at com.etl.JobManager.crawlDir(JobManager.java:196)
at com.etl.JobManager.run(JobManager.java:83)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

eclipse ini configuration

-startup
    plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
   --launcher.library
   plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
  -product
  org.eclipse.epp.package.jee.product
   --launcher.defaultAction
    openFile
   --launcher.XXMaxPermSize
   256M
  -showsplash
  org.eclipse.platform
   --launcher.XXMaxPermSize
   256m
  --launcher.defaultAction
  openFile
  -vmargs
  -Dosgi.requiredJavaVersion=1.5
   -Dhelp.lucene.tokenizer=standard
  -Xms40m
  -Xmx512m
lucifer
  • 2,297
  • 18
  • 58
  • 100
  • 1
    Do you have any chance to transfer those data in a stream? – Markus Malkusch Mar 05 '14 at 06:50
  • sorry i did not get u – lucifer Mar 05 '14 at 06:51
  • 1
    Try increasing your Heap space using the -Xms and -Xmx jvm parameters. Take a look at [this](http://stackoverflow.com/questions/14763079/what-are-the-xms-and-xmx-parameters-when-starting-jvms) question. – Tejas Kale Mar 05 '14 at 06:52
  • 1
    @lucifer you obviously blow your heap by loading all data into the memory. Check your API if it offers you a possibility to send that data not as one big chunk from memory but streamable. – Markus Malkusch Mar 05 '14 at 06:55
  • @TejasKale i am using eclipse ide when i am trying to change -Xmx and -Xmn eclipse is saying that it cannot create the JVM – lucifer Mar 05 '14 at 06:57
  • @lucifer What are the values you are using, and what is your system configuration? Remember, you can't have more than 4GB on a 32 bit system. – Tejas Kale Mar 05 '14 at 07:00
  • @TejasKale i am adding configuration with my post – lucifer Mar 05 '14 at 07:02
  • @lucifer Wait, that's your eclipse configuration, What parameters is the oracle JVM launched with? Those are the ones you need to tweak. – Tejas Kale Mar 05 '14 at 07:07
  • http://stackoverflow.com/questions/11266077/eclipse-heap-space-out-of-memory-error – Gundamaiah Mar 05 '14 at 07:08
  • Try ti increase the --launcher.XXMaxPermSize to 512M. Is this a standalone program or run on any Application server, if so you need to increase in application server. – Jay Mar 05 '14 at 07:10
  • @TejasKale -Xms40m -Xmx512m these two – lucifer Mar 05 '14 at 07:10
  • @lucifer eclipse.ini dictates the parameters for the Eclipse process, You will have different parameters for your oracle instance. In any case, -Xms is the min heap space that the process is launched with and It can expand upto a maximum of -Xmx. So configure it accordingly. – Tejas Kale Mar 05 '14 at 07:11
  • Whats the RAM size in your system and what is the available RAM memory ? – Jay Mar 05 '14 at 07:13
  • @Jay 4 gb(2.75) usable – lucifer Mar 05 '14 at 07:16
  • @TejasKale how far i can allocate these two parameters -Xms and -Xmx?? – lucifer Mar 05 '14 at 07:19
  • Don't you have any other 64 bits system with higher RAM to try this ? – Jay Mar 05 '14 at 07:23
  • @lucifer Depends completely on your RAM *and* your system architecture. For 32bit systems, the maximum is 4GB. – Tejas Kale Mar 05 '14 at 07:23

1 Answers1

0

Try to increase your -Xms and -Xmx parameters. You can use sthg like this;

--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx1024m
Semih Eker
  • 2,389
  • 1
  • 20
  • 29
  • @lucifer as I commented above, Its the oracle DB instance that needs to have more memory, not eclipse. – Tejas Kale Mar 05 '14 at 09:11
  • Is it a standalone Java program that you run in Eclipse ? If so you need to tune the JVM memory of Eclipse only. If its a code that is executed in a Application server like Weblogic then you need to tune the Weblogic JVM. I think its nothing to do with Oracle DB instance. – Jay Mar 05 '14 at 10:45
  • it is a application that is running in eclipse and not in any server. – lucifer Mar 05 '14 at 11:17
  • You get this error during the file read operation. How does your file read code looks like ? This link could give you some statistics http://stackoverflow.com/questions/18428657/reading-text-file-to-string-without-huge-memory-consumption – Jay Mar 05 '14 at 11:31