Gremlin server - java out of memory

614 views
Skip to first unread message

Rodrigo Lacerda

unread,
Jun 7, 2017, 7:15:33 PM6/7/17
to Gremlin-users
Hello!!

I'm having trouble running heavy queries with gremlin server.

I'm running like this:

Curl -X POST -d "{\"gremlin\": \"g.V().has('productId', 178293).as('p').in('view').out('view').barrier().where(neq('p')).groupCount().by('productId').order(local).by(values, decr).limit(local, 20)\", \" bindings \": {\"#Jsr223.groovy.engine.keep.globals\": \"phantom\"}}" "http://localhost:8182"

CPU processing goes to 300%. Then the error:

[WARN] HttpGremlinEndpointHandler - Invalid request - responding with 500 Internal Server Error and GC overhead limit exceeded
Java.lang.OutOfMemoryError: GC overhead limit exceeded

Running the query on gremlin console results in 10s.

Gremlin> g.V().has('productId', 178293).as('p').in('view').out('view').barrier().where(neq('p')).groupCount().by('productId').order(local).by(values, decr).limit(local, 20)

==> [131194: 633036,130076: 14134,301789: 14114,115201: 12113,178279: 12005,243206: 10114,301799: 10103,301811: 9082,302781: 9076,115,184: 8122,301781: 8118,115,200: 8068,105033: 8066,313766: 8064,178294: 7375,283873: 7057,301784: 6108,89171: 6079,241916: 6059,308824: 6051]

Is there anything I can do?

Thank you!

Stephen Mallette

unread,
Jun 7, 2017, 8:33:06 PM6/7/17
to Gremlin-users
Do you just submit that one traversal and then gremlin server goes OOME? or are you submitting lots of traversals like that? and what version of Gremlin Server are you using?

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/00944f0a-4c35-432b-9ba1-589ab6e497a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rodrigo Lacerda

unread,
Jun 7, 2017, 8:37:01 PM6/7/17
to Gremlin-users
Yes, just one query!

I'm using the latest version, 3.2.4.

Stephen Mallette

unread,
Jun 7, 2017, 9:00:32 PM6/7/17
to Gremlin-users
That's odd. I would start by throwing more -Xmx at it. Just see what you need to give it to get the traversal to complete. Clearly it doesn't have enough. If your application behaves normally with the larger -Xmx value then that would be a good sign. If you find that it serves that request but then starts OOME again with additional requests, then there might be some form of memory leak. 

On Wed, Jun 7, 2017 at 8:37 PM, Rodrigo Lacerda <r.lac...@gmail.com> wrote:
Yes, just one query!

I'm using the latest version, 3.2.4.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.

Rodrigo Lacerda

unread,
Jun 8, 2017, 8:22:18 AM6/8/17
to Gremlin-users
Thank you! 

I increased the memory for 4GB and it worked.

This specific query consumes about 3GB !!

HadoopMarc

unread,
Jun 8, 2017, 9:49:03 AM6/8/17
to Gremlin-users
3GB sounds crazy, it means the end point keeps all intermediate results in memory before it start filtering. Where is the barrier step for? What if you leave it out or interchange it with the where step?

Cheers,  Marc

Op donderdag 8 juni 2017 14:22:18 UTC+2 schreef Rodrigo Lacerda:

Robert Dale

unread,
Jun 8, 2017, 9:49:24 AM6/8/17
to gremli...@googlegroups.com
I see why that is.  Console doesn't specify any java opts. Thus, in java 8, the max heap is set to the "smaller of 1/4th of the physical memory or 1GB".  For example, on my laptop it gets set to 4G.  The gremlin server script specifically sets the max heap to 512m (if JAVA_OPTS is not otherwise set).  I'm wondering if it would make more sense to just remove that configuration so that console and server exhibit the same behavior.

Robert Dale

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages