Greetings BioStars,
Our SLURM log output for a successful co-assembly with MegaHit includes the following:
2026-08-06 17:53:53 - b'INFO utils/utils.h: 152 - Real: 577.4736\tuser: 316.8872\tsys: 67.0934\tmaxrss: 257052'
2026-08-06 17:53:53 - k-max reset to: 127
2026-08-06 17:53:53 - Start assembly. Number of CPU threads 8
2026-08-06 17:53:53 - k list: 27,37,47,57,67,77,87,97,107,117,127
2026-08-06 17:53:53 - Memory used: 486634136371
This SLURM job ran on node 29, which has a maximum of only 453 GB of RAM total (according to free_res).
MegaHit cannot be using 486 GB, like it says in the log output above, because that amount of RAM does not physically exist on this node. I don't think it could represent an estimate of RAM to be used either, because it hasn't counted kmers for our reads yet, according to the log output. The SLURM sacct outputs for this completed job show MaxRSS was 106 GB, MaxVM size 107 GB. It seems unlikely that 486 GB is cumulative RAM either (e.g. 100 + 100 + 100 + 186, at different times). The RequestedMem was 256 GB.
I noticed the same with other assemblers (MetaHipMer2): the software is claiming more memory than exists on the node, at the beginning of the job. "Initial free memory across all 1 nodes: 472.06GB (472.06GB avg, 472.06GB min, 472.06GB max)" per node. Again, not physically possible on that node.
What is the correct interpretation of these memory statements in these logs?
/////////////////////
The reason I ask is that, in trying to get various assemblers to work on our (larger and larger) datasets, it frequently comes down to some memory issue. Things get murky for our team between the Linux OS, SLURM, and the assembler software itself, in how memory is detected and allocated. For example, Slurm controls memory through the Linux cgroup functionality. I verified that our ConstrainRAMSpace setting is active in our cgroup.conf, which should enable SLURM to limit the amount of RAM provided during a job. But, it seems to make no difference: we still get these statements like above where the software is claiming more RAM than exists on the node.
We are at a disadvantage in troubleshooting memory issues, if we do not understand log outputs regarding memory for successful runs such as this.
Thanks very much for any additional information you could provide.
If you don't specify the amount of memory MegaHit can use with the
-moption, it may use the maximum available memory, which is calculated by thedetect_available_mem()function.https://github.com/voutcn/megahit/blob/c77d45c1f516e4f4a90c255c5c6d0c8ba27c017f/src/megahit#L596-L602
Thanks v much Arup!
So, now I can learn more about these OS vars, and why they are more than the physical memory on the node, as reported by free_res.
It still seems like the OS and then SLURM should take precedence in allocating compute resources such as RAM. We're still working on the mystery of why the ConstrainRAMSpace=yes in our cgroup.conf is not successfully enabling our OS to limit the amount of RAM claimed by the assembler script in a SLURM job (should have been 256 GB RAM above), regardless of whether or not memory flags are set in the assembler scripts themselves.
Or a better way to visualize / understand when and how the assembler scripts are interacting with the SLURM vars such as mem-per-cpu. I will try to dig through the source code some more as well.
Is your SLURM config setup to allow a main job to spawn subjobs? It is possible that assemblers are spawning sub-jobs and then accounting for the memory they are using that to come up with the larger number.
Since you have a finite amount of physical memory on node, there is no way to use more than what OS/SLURM allows. So the output of
sacctis what I would trust. If you are asking for 256G RAM then there is no way SLURM is going to allow that main process to use more (as long as it is properly configured). You also don't say how much swap is configured on your node. That could also be counting towards the number reported.What kind of issues? Are some jobs failing compared to others? Different assemblers are probably managing memory differently and some programs may be better then others at cleaning up after an operation completes.