Grakn 内存问题 windows 本地安装

Grakn mem issue windows local installation

我没有技术背景。我在 windows 本地将 grakn 安装到一个文件夹中,我能够启动服务器并使用工作库,但是当我尝试在文档教程 (social_network) 中执行计算查询时,它会抛出一个错误:

2020-08-18 16:59:33,614 [transaction-listener] ERROR g.c.s.r.SessionService$TransactionListener - Runtime Exception in RPC TransactionListener: java.lang.IllegalArgumentException: System memory 259522560 must be at least 471859200. Please increase heap size using the --driver-memory option or spark.driver.memory in Spark configuration.

然后我设置环境变量:

 "SERVER_JAVAOPTS": -Xmx4G
 "STORAGE_JAVAOPTS": -Xmx4G

结果:

Starting Storage....FAILED!
Unable to start Storage.
Process exited with code '1': 'Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.
Invalid maximum heap size: -Xmx4G
The specified size exceeds the maximum representable size.

An error has occurred during boot-up. Please run 'grakn server status' or check the logs located under the 'logs' directory.
Process exited with code '1': 'Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.
Invalid maximum heap size: -Xmx4G
The specified size exceeds the maximum representable size.

然后我设置环境变量:

 "SERVER_JAVAOPTS": -Xmx2G
 "STORAGE_JAVAOPTS": -Xmx2G

结果又是nok:

Starting Storage....FAILED!
Unable to start Storage.
Process exited with code '1': ''

An error has occurred during boot-up. Please run 'grakn server status' or check the logs located under the 'logs' directory.
Process exited with code '1': ''

然后我将环境变量设置为:

 "SERVER_JAVAOPTS": -Xmx1G
 "STORAGE_JAVAOPTS": -Xmx1G

现在结果还可以:

Starting Storage......SUCCESS
Starting Grakn Core Server.....SUCCESS

...但为什么我不能分配更多内存?我总共有 32GB,使用率约为 20%。 非常感谢。

这可能有两个原因:

  • JVM 无法分配 4G RAM,因为它被其他东西占用了。但是,正如您所说,只使用了 20% 或 RAM,这是不太可能的原因。
  • 32 位 JVM 无法寻址超过 4GB 的 RAM 1,因此您应该检查它是否适用于您,如果适用,请将您的 JVM 重新安装为 64 位。