Here How can I specify max memory per core for a Slurm job answers:
You can use
—mem=MaxMemPerNodeto use the maximum allowed memory for the job in that node.
My question is what happens if a job requires to use more memory than the maximum allowed memory.
Would the job be terminated by Slurm? or does it continue to run with limited memory, hence it will increase its run time due to limited memory it has?
Depending on the Slurm configuration, it will either