liupengjie - 2013-11-29

I install the Java API, when running demo WikipediaDefiner.java ,there is an error, my memory is 8 g, errors and the JVM configuration is as follows, I want to consult how to solve it, thank you very much

JVM configuration:

-Xms512m
-Xmx2G
-XX:MaxPermSize=256m
-XX:ReservedCodeCacheSize=128m
-XX:+UseCodeCacheFlushing
-XX:-UseGCOverheadLimit
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true

The console print error:

INFO org.wikipedia.miner.db.WEnvironment - caching label database: 13.00% in 00:00:30, ETA 00:03:23
INFO org.wikipedia.miner.db.WEnvironment - caching label database: 14.00% in 00:00:39, ETA 00:04:03
INFO org.wikipedia.miner.db.WEnvironment - caching label database: 15.00% in 00:00:47, ETA 00:04:27
INFO org.wikipedia.miner.db.WEnvironment - caching label database: 16.00% in 00:00:57, ETA 00:05:01
INFO org.wikipedia.miner.db.WEnvironment - caching label database: 17.00% in 00:01:09, ETA 00:05:39
INFO org.wikipedia.miner.db.WEnvironment - caching label database: 18.00% in 00:01:22, ETA 00:06:16
INFO org.wikipedia.miner.db.WEnvironment - caching label database: 19.00% in 00:01:39, ETA 00:07:04
INFO org.wikipedia.miner.db.WEnvironment - caching label database: 20.00% in 00:02:00, ETA 00:08:01
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at gnu.trove.THashMap.rehash(THashMap.java:382)
at gnu.trove.THash.postInsertHook(THash.java:370)
at gnu.trove.THashMap.doPut(THashMap.java:193)
at gnu.trove.THashMap.put(THashMap.java:161)
at org.wikipedia.miner.db.WDatabase.addToCache(WDatabase.java:541)
at org.wikipedia.miner.db.WDatabase.cache(WDatabase.java:471)
at org.wikipedia.miner.db.WEnvironment$PreparationThread.doPreparation(WEnvironment.java:601)
at org.wikipedia.miner.db.WEnvironment.<init>(WEnvironment.java:335)
at org.wikipedia.miner.model.Wikipedia.<init>(Wikipedia.java:62)
at WikipediaDefiner.main(WikipediaDefiner.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Process finished with exit code 1