Today, I encountered the same problem while running Picard. To solve the error, I used the option TMP_DIR=FILE, which allows the temp file to be written in the file provided instead of the system temp file. I guess similar option must be there for VARscan as well. However, while running varsan on 500GB mpileup files, I did not encounter any error.
I am running the somatic variant caller in VarScan on several files. On average, the input .pileup files are ~50 GB each (with both tumor and normal samples).
I've noticed that I've gotten the following error when running some samples:
Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
It doesn't happen for all files, and there still SNP and indel calls produced for samples that show this error. So, I would have to parse the error log if I wanted to go back and figure out which samples might be missing some variants.
Does anybody have a recommendation about how much memory should be allocated to java when running VarScan (with two ~50 GB .pileup file as the input)? I'm hoping that this can help avoid getting the error message.
1 answer
Ok, thanks for the prompt feedback.
Maybe I can play around with the .pileup file creation (such as decreasing the number of reads listed per position) in order to avoid getting this error.
Ok, cool - I will check this out. Thanks!
Log in to answer this question.
I don't think this error can be solved by memory allocation - it shows that the limit of the VM with respect of the size of the array not the actual amount of memory it uses up.
You may have plenty of memory around it is just the array is larger than Integer.MAX_INT. An array in Java can only contain that many elements.
See, if this link is of any use OutofMemory in solving your issue