2014-03-05 115 views
1

我想通过ETL在oracle中插入1.30 GB数据。但我在线程“池1线程1”中得到异常java.lang.OutOfMemoryError:Java堆空间错误。这是我的异常树如何解决Java堆空间错误

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) 

日食的ini配置

-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 
+1

您是否有机会在流中传输这些数据? –

+0

抱歉,我没有收到你的邮件 – lucifer

+1

尝试使用-Xms和-Xmx jvm参数来增加堆空间。看看[this](http://stackoverflow.com/questions/14763079/what-are-the-xms-and-xmx-parameters-when-starting-jvms)问题。 –

回答

0

尽量增加你的-Xms和-Xmx参数。你可以像这样使用sthg;

--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 
+0

仍然是这样的错误 – lucifer

+0

@lucifer正如我上面评论的那样,它的oracle数据库实例需要有更多的内存,而不是eclipse。 –

+0

Oracle实例是什么意思? – lucifer