简体   繁体   中英

OutOfMemoryError and how to make the run continue

I am using a Java API (JWPL) to process wikipedia dump, after I run some application, I got the error of OutOfMemory: Java heap space. Since I can't check the source code, what I can do is to increase the maximum assignment of heap size. Is there anything else I can do?

Another question is: the goal to run this application is to get some output textfiles, I already know the names of all the files, 11 in total. From last run, I got 7 files already, but it stopped with the above mentioned error. Now after I change the maximum heap size, I am wondering if there is a way that I can make the next run start from the point where it lefts over, because the duration of a complete run is like 8 hours. I simply don't want it start from very beginning, I just want to get the rest 4 files. I am quite new to Java, please give me some suggestions. Thanks in advance!

If you can run that Java app from command line then you can increase available memory for your app by using -Xmx switch:

Ie:

java -Xmx1024m MyApp

will give your process 1024 MegaBytes of memory.

And I'm afraid, that you are unable to get just remaining 4 files. You need to run the whole process again. (I assume you don't have the access to the source code)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM