solving heap size problem in linux
2
0
Entering edit mode
5.7 years ago
Liftedkris ▴ 30

hi. i am trying to remove contaminants from my fastq files using bbduk but it gives the following error. it says invalid maximum heapn size. i am using a linux system and do not know how to change the heap size or how to solve the problem. any help would be appreciated. thanks

bbduk.sh in1=D1C180_1.fastq in2=D1C180_2.fastq out1=cleanD1C180_1.fastq out2=D1C180_2 \
  ref=host_reference.fa k=31 mm=f
/home/s358309/bin/bbduk.sh: line 340: /home/s358309/bin//calcmem.sh: No such file or directory
/home/s358309/bin/bbduk.sh: line 341: parseXmx: command not found
/home/s358309/bin/bbduk.sh: line 345: freeRam: command not found
java -ea -Xmxm -Xmsm -cp /home/s358309/bin/current/ jgi.BBDuk in1=D1C180_1.fastq in2=D1C180_2.fastq out1=cleanD1C180_1.fastq out2=D1C180_2 ref=host_reference.fa k=31 mm=f

Invalid maximum heap size: -Xmxm
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
  
RNA-Seq • 4.4k views
ADD COMMENT
1
Entering edit mode

How are you running this? compute cluster?

This is usually caused by a a lack of memory, try giving it much more memory to work with.

and is java available on your system?

ADD REPLY
3
Entering edit mode

Are those flags correct? -Xmxm -Xmsm

I'm no Java expert, but I think the flags don't normally have the last m? They should also be followed by a number for how much memory you want to use

ADD REPLY
1
Entering edit mode

The parameters should be e.g. -Xmx 128M -Xms 16M. These are allocating respectively the maximum and initial heap size for the JVM.

ADD REPLY
0
Entering edit mode

For bbduk.sh you should need not much RAM. Even a couple of gigs would be enough. Assign it explicitly in your command like this:

bbduk.sh -Xmx2g in1=D1C180_1.fastq in2=D1C180_2.fastq out1=cleanD1C180_1.fastq out2=D1C180_2 ref=host_reference.fa k=31 mm=f
ADD REPLY
3
Entering edit mode
5.7 years ago
h.mon 35k

Somehow the installation of the BBMap / BBTools suite is botched. BBTools programs in general dynamically calculate the memory available at the computer they are running, and set (if I remember correctly) 85% of that memory to the Java virtual machine. But bbduk.sh is not finding calcmem.sh, hence it can't calculate the memory it should reserve and is using an empty string to build the actual java command, thus the odd-looking -Xmxm -Xmsm.

Did you add the base BBTools directory to the PATH? Supposing BBTools scripts are located at /home/s358309/bin/, do:

export PATH=/home/s358309/bin:$PATH
ADD COMMENT
0
Entering edit mode
3.5 years ago
Tirtha • 0

Try removing bbmap first and install from anaconda. Use the following command:

conda install -c bioconda bbmap

You might need to install anaconda first if it isn't installed.

Cheers :)

ADD COMMENT

Login before adding your answer.

Traffic: 2850 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6