Memory leak in Gremlin query

145 views
Skip to first unread message

Elad

unread,
Oct 20, 2015, 4:46:31 AM10/20/15
to OrientDB
Checked on version 2.1.4 and 2.0.8
We run batch scripts with many queries (around 200K) in the form of:
select gremlin(....) from User limit 1

After a while I got the following exceptions (on 2.1.4):
{db=test} Error during context close for db null
com.orientechnologies.orient.core.exception.OStorageException: Invalid value of TX counter
        at com.orientechnologies.orient.core.tx.OTransactionOptimistic.rollback(OTransactionOptimistic.java:175)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2595)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2551)
        at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.shutdown(OrientBaseGraph.java:1169)
        at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.shutdown(OrientBaseGraph.java:1155)
        at com.orientechnologies.orient.graph.gremlin.OGremlinHelper.releaseGraph(OGremlinHelper.java:330)
        at com.orientechnologies.orient.graph.gremlin.OGremlinHelper.execute(OGremlinHelper.java:158)
        at com.orientechnologies.orient.graph.gremlin.OGremlinHelper.execute(OGremlinHelper.java:73)
        at com.orientechnologies.orient.graph.sql.functions.OSQLFunctionGremlin.execute(OSQLFunctionGremlin.java:68)
        at com.orientechnologies.orient.core.sql.functions.OSQLFunctionRuntime.execute(OSQLFunctionRuntime.java:127)
        at com.orientechnologies.orient.core.sql.ORuntimeResult.applyRecord(ORuntimeResult.java:116)
        at com.orientechnologies.orient.core.sql.ORuntimeResult.getProjectionResult(ORuntimeResult.java:222)
        at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.addResult(OCommandExecutorSQLSelect.java:608)
        at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.handleResult(OCommandExecutorSQLSelect.java:578)
        at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearchRecord(OCommandExecutorSQLSelect.java:538)
        at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetchFromTarget(OCommandExecutorSQLSelect.java:1431)
        at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OCommandExecutorSQLSelect.java:469)
        at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommandExecutorSQLSelect.java:427)
        at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:90)
        at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:1452)
        at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1433)
        at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:63)
        at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1319)
        at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:396)
        at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:223)
        at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)

Error during WAL background flush
java.lang.OutOfMemoryError: Java heap space
        at com.orientechnologies.common.directmemory.OUnsafeMemoryJava7.get(OUnsafeMemoryJava7.java:30)
        at com.orientechnologies.common.directmemory.ODirectMemoryPointer.get(ODirectMemoryPointer.java:79)
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment$FlushTask.commit(ODiskWriteAheadLog.java:201)
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment$FlushTask.run(ODiskWriteAheadLog.java:138)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

Any advice?

Luca Garulli

unread,
Oct 20, 2015, 5:45:15 PM10/20/15
to OrientDB
Hi,
Could you run a profiler, like YourKit, and attaching to the JVM retrieving the strong references in the heap?

Best Regards,

Luca Garulli
Founder & CEO


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Elad

unread,
Oct 21, 2015, 8:13:31 AM10/21/15
to OrientDB
Hi Luca,

I analyzed the heapdump using VisualVM, and this is what I see:


I drilled down to the ConcurentHashMap entries and see that all related to com.tinkerpop classes.

 

Thanks,
Elad

Elad

unread,
Oct 29, 2015, 6:01:38 AM10/29/15
to OrientDB
Any advice anyone?
Reply all
Reply to author
Forward
0 new messages