I am getting an error upon running Picard SamFormatConverter: Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
Looking in GATK and Biostars threads, this issue seems to come up frequently. The .sam file I start with is 67Gb, which I think is not unreasonably large.
I don't understand the memory requirements for java or where capacity is needed. I believe I have specified near the max memory for java processes by giving the command 20 gigs of memory ("-java -Xmx20g"). I am running all this on an Oracle-VM with Ubuntu 16.04. Windows and Ubuntu both say the computer has ~21 gigs of free RAM
Could there simply be an error in the script that is causing it to think there is not enough memory? Or is there some way to test how much memory is needed? How much memory would likely be enough to run Exome pipelines through Bwa, Picard, GATK, etc?
Thank you very much,