Changing the Dgraph memory limit

You can set a custom limit on the amount of memory the Dgraph can consume with the --memory-limit flag.

Note: This flag is intended for use by Oracle Support, only.

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.

Note: If you use the --cmem flag, cache size (--cmem) should always be smaller than memory limit (the --memory-limit flag). In addition, if you enter an invalid value to the --memory-limit flag, the Dgraph will ignore that flag and instead use the default memory limit value.

For information on all Dgraph flags, see Dgraph flags.

To change the memory limit:

  1. On the Admin Server, go to $BDD_HOME/BDD_manager/conf directory and make a copy of the bdd.conf file in a different location.
  2. Open the copy and add the --memory-limit flag to the DGRAPH_ADDITIONAL_ARG property.
    Be sure to save the file before closing.
  3. Go to $BDD_HOME/BDD_manager/bin and run:
    ./bdd-admin.sh publish-config bdd <path>
    Where <path> is the absolute path to the modified copy of bdd.conf.
    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 bdd.conf.
  4. Restart the Dgraph so your changes take effect.