Execute query, alpha takes up high memory and ends up OOM

From my experience, Graphs when expanded in the cluster(no written) takes a lot of RAM to do so. The same happens if you expand JSON in an application. It will escalate the RAM usage. I’ve did a JavaScript application once to deal with gigantic JSONs and it consumes a lot of memory. But shortly after it freed up the RAM.

And the RAM management in GO is tricky. We’ve already implemented pretty good RAM management with jemalloc. But Graphs are a bit RAM consumers. Especially when you do very complex queries. That add multiple filters and so on. The need to use filters and other parameters has to be evaluated. Because all this will be computed in some instance of Dgraph (on the server or cloud), not on your machine.

Complex queries made every now and then is normal. But making them everyday use is something you need to calculate the increase in resources to be made available.