简体   繁体   中英

GATE PersistenceManager.loadObjectFromFile outofmemory error while loading .gapp files

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.

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 (eg gazetteer lists) between gate applications. It can be done using Factory.duplicate(Resource) . See eg slides from Developers GATE Course .

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