We are using JanusGraph with Cassandra DB. Our schema is simple and it works fine with small and medium samples, however, we get memory issues when the data grows, even with very simple queries.
The following query:
g.V().hasLabel('customer')
for more than 3 million users, produces the following error:
{"message":"Java heap space","Exception-Class":"java.lang.OutOfMemoryError","exceptions":["java.lang.OutOfMemoryError"],"stackTrace":"java.lang.OutOfMemoryError: Java heap space\n\tat java.util.Arrays.copyOfRange(Arrays.java:3664)\n\tat java.lang.String.<init>(String.java:207)\n\tat java.lang.StringBuilder.toString(StringBuilder.java:407)\n\tat org.apache.tinkerpop.shaded.jackson.core.util.TextBuffer.contentsAsString(TextBuffer.java:404)\n\tat org.apache.tinkerpop.shaded.jackson.core.io.SegmentedStringWriter.getAndClear(SegmentedStringWriter.java:83)\n\tat org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3213)\n\tat org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0.serializeResponseAsString(GraphSONMessageSerializerV1d0.java:98)\n\tat org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler.lambda$channelRead$1(HttpGremlinEndpointHandler.java:250)\n\tat org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler$$Lambda$172/1143745749.apply(Unknown Source)\n\tat org.apache.tinkerpop.gremlin.util.function.FunctionUtils.lambda$wrapFunction$0(FunctionUtils.java:36)\n\tat org.apache.tinkerpop.gremlin.util.function.FunctionUtils$$Lambda$173/1328679220.apply(Unknown Source)\n\tat org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:297)\n\tat org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor$$Lambda$104/1217416538.call(Unknown Source)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n"}
Is this supposed to happen? Or we need to adjust our Java heap or JanusGraph server configuration?