我正在尝试从White Paper "Text Mined Knowledge Graphs"中重现BioGrakn示例,目的是稍后从我的(非生物医学)文档集合中构建一个文本挖掘的知识图谱。因此,我在biograkn repo中的文本挖掘用例的类和数据的基础上构建了一个Maven项目。我的pom.xml是这样的:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>TextMining-BioGrakn</groupId>
<artifactId>TextMining-BioGrakn</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>TextMining-BioGrakn</name>
<repositories>
<repository>
<id>repo.grakn.ai</id>
<url>https://repo.grakn.ai/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.grakn.client</groupId>
<artifactId>api</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>io.grakn.core</groupId>
<artifactId>concept</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>io.graql</groupId>
<artifactId>lang</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
<classifier>models</classifier>
</dependency>
</dependencies>
</project>
迁移模式、插入发布的文章并训练模型可以完美地工作,但随后我得到了一个java.lang.OutOfMemoryError: GC overhead limit exceeded
,它被抛出在CoreNLP类的mineText()
方法中。Migrator类中的main方法如下所示:
public class Migrator {
public static void main(String[] args) {
GraknClient graknClient = new GraknClient("localhost:48555");
GraknClient.Session session = graknClient.session("text_mining");
try {
loadSchema("schema/text-mining-schema.gql", session);
PubmedArticle.migrate(session);
CoreNLP.migrate(session);
} catch (Exception e) {
e.printStackTrace();
session.close();
}
session.close();
graknClient.close();
}
}
你知道导致这个错误的原因是什么吗?我是不是遗漏了什么基本的东西?任何帮助都是非常感谢的。
发布于 2019-07-23 21:41:13
您可能需要使用allocate more memory for your program。
如果有一些bug导致了这个问题,那么capture a heap dump (hprof) using the HeapDumpOnOutOfMemoryError flag。(确保命令行标志的顺序是正确的:Generate java dump when OutOfMemory)
一旦你有了hprof,你就可以使用Eclipse Memory Analyzer Tool来分析它,它有一个非常好的“泄漏疑似报告”,你可以在启动时运行,这将帮助你看到是什么导致了过多的内存使用。在任何看起来像泄漏的非常大的对象上使用'Path to GC root‘来查看是什么使它们在堆上保持存活。
如果你需要关于是什么导致泄漏的另一个意见,检查一下IBM Heap Analyzer Tool,它也工作得很好。
祝好运!
https://stackoverflow.com/questions/57164755
复制相似问题