samtools sorts allocate memory for bam_mem issues

samtools sorts allocate memory for bam_mem issues


Hello everyone
ı am trying to convert sam to bam

samtools sort -@ 8 -o UHR_Rep1.bam UHR_Rep1.sam

and ı got this error

samtools sort: couldn’t allocate memory for bam_mem

ı check my disk memory and ı see have enough space in my disk.How I can achieve this problem?






Depending on the size of the BAM file you have you may not be able to do this on your machine. You have only 3.7 G of RAM out of which 1.2 G seems to be available when you ran the above command. Generally samtools will use temporary files to do the sort (and writes them to the directory you ran this from, I assume that is the disk where you have space).

I suggest that you try this sort with just one thread (i.e remove -@ 8) and see if following works. It may take a while to sort the file so be patient if the following starts running without the memory error.

samtools sort -o UHR_Rep1.bam UHR_Rep1.sam

before adding your answer.

Read more here: Source link