Search code examples
graph-databasesmemgraphdb

Can I limit the memory usage during the procedure call in Memgraph?


I want to increase the memory limit for the procedure call to a value higher than the default one. Can I set it to use all of the available memory?


Solution

  • When running a procedure, Memgraph controls the maximum memory usage that the procedure may consume during its execution. By default, the upper memory limit when running a procedure is 100 MB. If your query procedure requires more memory to yield its results, you can increase the memory limit using the following syntax:

    CALL module.procedure(arg1, arg2, ...) PROCEDURE MEMORY LIMIT 100 KB YIELD result;
    CALL module.procedure(arg1, arg2, ...) PROCEDURE MEMORY LIMIT 100 MB YIELD result;
    CALL module.procedure(arg1, arg2, ...) PROCEDURE MEMORY UNLIMITED YIELD result;
    

    The limit can be specified to a specific value (either in KB or MB), or it can be set to unlimited.