GATE PersistenceManager.loadObjectFromFile outofmemory error while loading .gapp files

让人想犯罪 __ 提交于 2019-12-25 16:37:38

问题


While loading .gapp files from disc using PersistenceManager.loadObjectFromFile I got the, "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space" Error. I increased the heap size to a maximum of 2048M and got the issue fixed. Is there a better alternative way to solve this issue when loading a large set of .gapp files.


回答1:


I think not, if you are using the default garbage collector. It needs the max heap size parameter for its work. Note that the memory is really needed. The error says that there was not enough memory for your gate applications (loaded gapp files).

There are two things you can do:

  1. Find a lower value of max heap size parameter that is still working.

  2. Reduce the amount of memory needed. For example by sharing some large objects (e.g. gazetteer lists) between gate applications. It can be done using Factory.duplicate(Resource). See e.g. slides from Developers GATE Course .



来源:https://stackoverflow.com/questions/28807678/gate-persistencemanager-loadobjectfromfile-outofmemory-error-while-loading-gapp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!