Changing the Dgraph memory limit

It is possible to specify the custom memory limit the Dgraph is allowed to use for processing. If you change the memory limit, this overrides the default memory consumption setting in the Dgraph that is set to 80% of the machine's available RAM.

Note: It is recommended that Oracle Support change the limit on Dgraph memory consumption.

By default, the memory limit that the Dgraph is allowed to use is 80% of the machine's available RAM. This behavior ensures that the Dgraph never runs out of memory during the course of its query processing or data ingest activity.

You can override the default limit and set a custom limit on the amount of memory the Dgraph can consume in MB, using the --memory-limit flag. If this value is set, then the amount of memory required by the Dgraph to process all current queries can't exceed this limit.

Once the Dgraph reaches a memory consumption limit set with this flag, then, similar to how it behaves with the default memory limit of 80%, the Dgraph starts to cancel queries, beginning with the query that is consuming the most amount of memory. When the Dgraph cancels a query, it logs the amount of memory the query was using and the time it was cancelled for diagnostic purposes.

The Dgraph --memory-limit can be set after the installation through the DGRAPH_ADDITIONAL_ARG parameter in the bdd.conf file in the $BDD_HOME/BDD_manager/conf directory.

Using the --memory-limit flag with a value of 0 means there is no limit set on the amount of memory the Dgraph can use.

For information on all Dgraph flags, see Dgraph flags.

To change the memory limit:

  1. Go to $BDD_HOME/BDD_manager/conf directory and locate the bdd.conf file.
  2. In the setting for DGRAPH_ADDITIONAL_ARG, specify the --memory-limit flag.
  3. Save the bdd.conf file.
  4. Run the bdd-admin.sh publish-config bdd command.
    This refreshes the configuration on all the Dgraph hosting machines with the modified settings from the bdd.conf file. For information on how to do this, see Updating the BDD configuration.
  5. Restart the Dgraph with the bdd-admin.sh script.