I am trying to use samtools sort function to sort a bam file (named as PT2) (size 180 megabite), which is not large. The sorting never end and no error message appeared. I have checked the memory of the VM Ubunto using (meminfo file in the proc folder on the home account). Also I have around 80 gig disc space 

First code (extremely slow) : 

    samtools sort -o outputs/PT2_sorted.bam outputs/PT2.bam

second code (very slow): 

    samtools sort -o outputs/PT2_sorted.bam outputs/PT2.bam

What do you think is a reason behind this slow working ? any advice ? 

Thanks 
That was resolved. The point was to increase the VM memory from 1024 to around 1800. This enabled running the command (even without adding `-m` or `-T`) 

Thanks 