You can set a custom limit on the amount of memory the Dgraph can consume with the --memory-limit flag.
When this flag is set, then the amount of memory required by the Dgraph to process all current queries can't exceed its value. Once this limit is reached, the Dgraph begins cancelling queries in the same way it does with the default limit.
You can set the --memory-limit flag by adding it to the DGRAPH_ADDITIONAL_ARG property in $BDD_HOME/BDD_manager/conf/bdd.conf.
Using a value of 0 means there is no limit set on the amount of memory the Dgraph can use. In this case, be aware that the Dgraph will use all the memory on the machine that it can allocate for its processing without any limit, and will not attempt to cancel any queries that may require the most amount of memory. This, in turn, may lead to out-of-memory page thrashing and require the Dgraph to be restarted manually.
For information on all Dgraph flags, see Dgraph flags.
To change the memory limit: