The Dgraph cache size must be large enough for the to Dgraph operate smoothly under a normal query load.
This means that an occasional spike in Dgraph cache usage shouldn't be cause for alarm. You should only consider adjusting the Dgraph cache size after observing Dgraph performance over longer periods of time.
You can adjust the size of the Dgraph cache by gradually changing the DGRAPH_CACHE value in the $BDD_HOME/BDD_manager/conf/bdd.conf. (This property maps to the Dgraph --cmem flag.) You can then use the bdd-admin script to publish your changes to the entire cluster. For more information, see publish-config.
For enhanced performance, Oracle recommends allocating at least 50% of the node's available RAM to the Dgraph cache. This is a significant amount of memory that you can adjust if needed. For example, if you later find that queries are getting cancelled because there is not enough available memory to process them, you should decrease this amount.
Note that the percentage of memory used for the Dgraph cache is determined by the total amount of RAM on the machine, but is taken out of the percentage allocated to the Dgraph, which by default is 80%. For example, if the machine has 100MB of available RAM, the Dgraph would have access to 80MB, 50MB of which would be available for the cache.