tberg12 / ocular

Ocular is a state-of-the-art historical OCR system.
GNU General Public License v3.0
252 stars 48 forks source link

java.lang.OutOfMemoryError: Java heap space #10

Open haroldfry opened 6 years ago

haroldfry commented 6 years ago

Hi, I got this error when I was trying to train a font with a language model trained on large corpus (over 200MB). The language model created is around 43MB and the initialized font is around 57MB. I have no problem using the software with a smaller size corpus. Any idea how to fix the problem?

Initializing EmissionModel 2018/02/28 22:34:49 Rebuilding cache 2018/02/28 22:34:49 Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.simontuffs.onejar.Boot.run(Boot.java:340) at com.simontuffs.onejar.Boot.main(Boot.java:166) Caused by: java.lang.OutOfMemoryError: Java heap space at edu.berkeley.cs.nlp.ocular.model.emission.CachingEmissionModel.rebuildCache(CachingEmissionModel.java:281) at edu.berkeley.cs.nlp.ocular.model.DecoderEM.computeEStep(DecoderEM.java:91) at edu.berkeley.cs.nlp.ocular.train.FontTrainer.doFontTrainPass(FontTrainer.java:185) at edu.berkeley.cs.nlp.ocular.train.FontTrainer.trainFont(FontTrainer.java:95) at edu.berkeley.cs.nlp.ocular.main.TrainFont.run(TrainFont.java:76) at edu.berkeley.cs.nlp.ocular.main.OcularRunnable.doMain(OcularRunnable.java:25) at edu.berkeley.cs.nlp.ocular.main.TrainFont.main(TrainFont.java:41) ... 6 more

dhgarrette commented 6 years ago

You should be able to give the JVM more heap space with the -Xmx flag.