We had a case where we were trying to downsample 11 billion reads with 1 TB of RAM and seqtk said it needed more RAM.
Below, a suggestion was made to resolve the issue; however, it will run slower.
Usage: seqtk sample [-2] [-s seed=11] <in.fa> <frac>|<number>
Options: -s INT RNG seed [11]
-2 2-pass mode: twice as slow but with much reduced memory