Skip to content

MEGAHIT Memory setting

Dinghua Li edited this page Jun 20, 2015 · 4 revisions

The -m/--memory option specifies the max memory that can be used by megahit_sdbg_build. When 0 < -m < 1, fraction of all available memory of the machine is used, otherwise it specifies the memory in BYTE. By default -m is 0.9.

The SdBG construction algorithm in MEGAHIT requires to hold all reads/k-mers in memory. The algorithm will scan the reads/k-mers for several times for partitioning and sorting -- the more memory to be used, the less number of scanning times. Therefore MEGAHIT runs faster with more memory.

When the memory is not enough to hold all reads/k-mers or perform sorting, MEGAHIT halts.

Since v0.2.0, it is not necessary for the SdBG builder to use up all the memory specificed by -m. The option --mem-flag specifies the ways to utilize memory: --mem-flag 0 to use minimum memory, --mem-flag 1 (default) moderate memory and --mem-flag 2 all memory.

Clone this wiki locally