AnyListen / elasticsearch-analysis-hanlp

HanLP Analysis for Elasticsearch
88 stars 30 forks source link

安装hanlp插件后,节点就内存溢出outofmemory #10

Open jacklu2016 opened 4 years ago

jacklu2016 commented 4 years ago

java.lang.OutOfMemoryError: Java heap space at com.hankcs.hanlp.model.perceptron.model.LinearModel.load(LinearModel.java:434) ~[?:?] at com.hankcs.hanlp.model.perceptron.model.LinearModel.load(LinearModel.java:388) ~[?:?] at com.hankcs.hanlp.model.perceptron.model.LinearModel.(LinearModel.java:65) ~[?:?] at com.hankcs.hanlp.model.perceptron.PerceptronLexicalAnalyzer.(PerceptronLexicalAnalyzer.java:70) ~[?:?] at com.hankcs.hanlp.model.perceptron.PerceptronLexicalAnalyzer.(PerceptronLexicalAnalyzer.java:95) ~[?:?] at com.hankcs.hanlp.HanLP.newSegment(HanLP.java:685) ~[?:?] at org.elasticsearch.plugin.hanlp.conf.ConfigHelper.lambda$getSegment$0(ConfigHelper.java:149) ~[?:?] at org.elasticsearch.plugin.hanlp.conf.ConfigHelper$$Lambda$1685/783382452.run(Unknown Source) ~[?:?] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_65] at org.elasticsearch.plugin.hanlp.conf.ConfigHelper.getSegment(ConfigHelper.java:132) ~[?:?] at org.elasticsearch.plugin.hanlp.analysis.HanLPAnalyzerProvider.(HanLPAnalyzerProvider.java:35) ~[?:?] at org.elasticsearch.plugin.hanlp.analysis.HanLPAnalyzerProvider.getPerceptronAnalyzerProvider(HanLPAnalyzerProvider.java:51) ~[?:?] at org.elasticsearch.plugin.hanlp.AnalysisHanLPPlugin$$Lambda$446/905650857.get(Unknown Source) ~[?:?] at org.elasticsearch.index.analysis.AnalysisRegistry.buildMapping(AnalysisRegistry.java:362) ~[elasticsearch-6.1.1.jar:6.1.1] at org.elasticsearch.index.analysis.AnalysisRegistry.buildAnalyzerFactories(AnalysisRegistry.java:187) ~[elasticsearch-6.1.1.jar:6.1.1] at org.elasticsearch.index.analysis.AnalysisRegistry.build(AnalysisRegistry.java:157) ~[elasticsearch-6.1.1.jar:6.1.1] at org.elasticsearch.index.IndexService.(IndexService.java:160) ~[elasticsearch-6.1.1.jar:6.1.1]

JrJessyLuo commented 4 years ago

I had the same problem. But I solved it by modifying the file “jvm.options” in the “config” directory. I changed the "-Xms1g -Xmx1g" to "-Xms4g -Xmx4g".