atilika / kuromoji

Kuromoji is a self-contained and very easy to use Japanese morphological analyzer designed for search
Apache License 2.0
950 stars 131 forks source link

how to increase heap size other than MAVEN_OPS #133

Open kazukousen opened 3 years ago

kazukousen commented 3 years ago

I hope to build kuromoji with neologd on CircleCI. i try to increase heap size, so set env `MAVEN_OPTS="-Xmx4096m -XX:-UseGCOverheadLimit". but OutOfMemoryError occurs:

...
[KUROMOJI] 02:40:21:     reading tokeninfo
[WARNING] 
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 org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:297)
    at java.lang.Thread.run (Thread.java:748)
Caused by: java.lang.OutOfMemoryError: Java heap space
...

debugged using -X option, then

env.MAVEN_OPTS= -Xmx4096m -XX:-UseGCOverheadLimit -Xmx512m

-Xmx512m found, so i think -Xmx4096m was overrode by this -Xmx512m. i can't understand fundamental issue that why has set already -Xmx512m, but i should like to know if there is another way to increase heap size.

can you tell me any idea to avoid this issue? thanks.