Invalid maximum heap size: -Xmx4g

opulcyopulcy Member

Hi,
I was trying to run GenomeSTRiP "installtest/discovery.sh" and getting the following error:

Invalid maximum heap size: -Xmx4g
The specified size exceeds the maximum representable size.

As I don't know much about technical aspect of running .jar files, I thought it's a memory issue and I increased the heap size to -Xmx16g and getting the same error.

Can anyone please tell me how to solve this problem?

Thanks in advance.

Best Answer

Answers

  • opulcyopulcy Member

    Hi,

    I had a look around and I found that: if The heap size is larger than JVM thinks you would ever need, then assigning to lower reasonable value fixes the problem. Therefore, I lowered the heap size to -Xmx1g, it ran. However, I could still see some error generating for the same reason in between running the script. The following error occurs 3/4 times and I don't know where to go to fix it:

    ERROR 10:20:07,475 FunctionEdge - Error: 'java' '-Xmx4096m' '-XX:+UseParallelOldGC' '-XX:ParallelGCThreads=4' '-XX:GCTimeLimit=50' '-XX:GCHeapFreeLimit=10' '-Djava.io.tmpdir=/scratch/fr1u11/GENOME_STRIP/svtoolkit/installtest/.queue/tmp' '-cp' '/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/SVToolkit.jar:/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/gatk/GenomeAnalysisTK.jar:/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/gatk/Queue.jar' '-cp' '/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/SVToolkit.jar:/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/gatk/GenomeAnalysisTK.jar:/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/gatk/Queue.jar' 'org.broadinstitute.sv.apps.CreateMetaDataDirectory' -l DEBUG '-md' 'test1/metadata'
    ERROR 10:20:07,479 FunctionEdge - Contents of /scratch/fr1u11/GENOME_STRIP/svtoolkit/installtest/test1/logs/SVPreprocess-1.out:
    Invalid maximum heap size: -Xmx4096m
    The specified size exceeds the maximum representable size.
    Could not create the Java virtual machine.

    A helpful tip would be much appreciated.
    Thanks in advance.

  • bhandsakerbhandsaker Member, Broadie, Moderator admin

    You are going to need to be able to run with a java heap of 4G to successfully run genome strip.
    You need to talk to your system administrator to find out why your java heap size is limited (perhaps only on some of your nodes?).
    Maybe you are running 32-bit java? Try "java -version".

  • opulcyopulcy Member

    Hi,

    Thanks for the reply. Following is my java version:

    java version "1.6.0_26"
    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
    Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

    Regards.

  • bhandsakerbhandsaker Member, Broadie, Moderator admin

    I think that's 32-bit. See mine (below), which says 64-bit explicitly. I doubt you will be able to run successfully without a 64-bit version of java.

    java version "1.6.0_35"
    Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
    Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01, mixed mode)

  • opulcyopulcy Member

    Hi,

    Thanks for the reply. I have changed JAVA and now the info on java version as follows:

    java version "1.7.0_17"
    Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
    Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

    But the error still persists. I am using GATK with the option -Xmx4g and it's running fine.

    One interesting thing is, even I lower the memory heap to -Xmx1g, in the error it's showing 4g:

    INFO 16:38:27,576 QGraph - Failed: 'java' '-Xmx4096m' '-XX:+UseParallelOldGC' '-XX:ParallelGCThreads=4' '-XX:GCTimeLimit=50' '-XX:GCHeapFreeLimit=10' '-Djava.io.tmpdir=/scratch/fr1u11/GENOME_STRIP/svtoolkit/installtest/.queue/tmp' '-cp' '/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/SVToolkit.jar:/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/gatk/GenomeAnalysisTK.jar:/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/gatk/Queue.jar' '-cp' '/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/SVToolkit.jar:/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/gatk/GenomeAnalysisTK.jar:/scratch/fr1u11/GENOME_STRIP/svtoolkit/lib/gatk/Queue.jar' 'org.broadinstitute.sv.apps.CreateMetaDataDirectory' -l DEBUG '-md' 'test1/metadata'
    INFO 16:38:27,576 QGraph - Log: /scratch/fr1u11/GENOME_STRIP/svtoolkit/installtest/test1/logs/SVPreprocess-1.out

    I got stuck with this problem for quite a long time.

    Thanks for all your help.

    Regards

Sign In or Register to comment.