Description
When using paftools call -f <reference>
with k8-1.0 I now get OOM errors like
<--- Last few GCs --->
[26894:0x192f630] 3176 ms: Mark-sweep (reduce) 1449.0 (1450.8) -> 1449.0 (1450.6) MB, 0.6 / 0.0 ms (average mu = 0.997, current mu = 0.991) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
#
# Fatal javascript OOM in Reached heap limit
Trying to adjust the heap size with export NODE_OPTIONS="--max-old-space-size=10000"
etc did not help. I checked this with both commits 9506e7a and bc588c0. I tested the exact same call and files with k8-0.2.5 and it works fine.
I was playing around in the code and it seems to be an issue of the size of the sequence dictionary h
. I can get this to run (up to an expected error about missing contigs) by only selecting the first 12 contigs (totalling 1431554824 bp), but then crashed on trying with 13 contigs (totalling 1518796476 bp). It also works removing the first 15 or so contigs (totalling 1470948544 bp), so it is definitely related to the size of the values rather than the size of the keys.
Changing this line to some random short string rather than the sequence line allows the fasta to be read and then crashes later because the sequence lengths obviously don't match the variant positions.
Line 174 in f3e59fc
Changing the fasta line lengths (seqtk seq -l 60
) also doesn't help.
I have no idea why it appears the dict can't handle >1.5 Gb of strings in k8 v1 but can in k8 v0.2.5, but that appears to be the case.
Best,
Alex