Genome Analysis Toolkit

Variant Discovery in High-Throughput Sequencing Data

GATK process banner

Need Help?

Search our documentation

Community Forum

Hi, How can we help?

Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools with a primary focus on variant discovery and genotyping. Its powerful processing engine and high-performance computing features make it capable of taking on projects of any size. Learn more

Mutect2 (tumor & matched normal) - Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

0

2 comments

  • Avatar
    Genevieve Brandt (she/her)

    Hi Lauren Eldershaw, there are a couple things to try. First, adding the java option -Xmx with how much memory the program can use. See how to use java options here. Second, use a temporary directory that is large enough to hold the intermediate files. The option is --tmp-dir (Mutect2 docs). And finally, make sure you have enough space on your machine to run this program.

    0
    Comment actions Permalink
  • Avatar
    jefryarch


    Usually, this error is thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector.

    Therefore you pretty much have two options:

    • Increase the default memory your program is allowed to use using the -Xmx option (for instance for 1024 MB: -Xmx1024m)
    • Modify your program so that it needs less memory, using less big data structures and getting rid of objects that are not any more used at some point in your program

    Increasing the heap size is a bad solution, 100% temporary. It will crash again in somewhere else. To avoid these issues, write high performance code.

    • Use local variables wherever possible.
    • Make sure you select the correct object (EX: Selection between String, StringBuffer and StringBuilder)
    • Use a good code system for your program(EX: Using static variables VS non static variables)
    • Other stuff which could work on your code.
    • Try to move with Multy Threading

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk