Search code examples
vaticle-typedb

Grakn mem issue windows local installation


I don't have a tech background. I installed grakn locally on windows into a folder, I am able to start the server and use the workbase, however when I tried to do the compute query in the documentation tutorial (social_network), it throws an error:

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.

I then set env variables:

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

Outcome nok:

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.

I then set env variables:

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

Outcome again 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': ''

I then set env variables to this:

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

Outcome now is ok:

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

...but why can't I assign more mem? I have totally 32GB and usage is around 20%. Many thanks in advance.


Solution

  • There are two possible reasons for this:

    • JVM is unable to allocate 4G of RAM because it's occupied by something else. However, as you've said only 20% or RAM is used, this is an unlikely reason.
    • 32-bit JVM are unable to address more than 4GB of RAM 1, so you should check if it applies to you and reinstall your JVM to be 64-bit if it does.