Some quick notes about mlock, running GridGraph with set to a limited number results in error.
Documentation for mlock
This specifies the amount of memory you can lock, preventing from being swapped.
mlock() and mlockall() respectively lock part or all of the calling process’s virtual address space into RAM, preventing that memory from being paged to the swap area. munlock() andmunlockall() perform the converse operation, respectively unlocking part or all of the calling process’s virtual address space, so that pages in the specified virtual address range may once more to be swapped out if required by the kernel memory manager. Memory locking and unlocking are performed in units of whole pages.
To check you mlock limit
it will show “unlimited” if it is set to unlimited.