Why am I getting the - too small running heap when running Java?

598    Asked by AmandaHawes in Java , Asked on Oct 13, 2022

 I'm trying to run the Java program trimmomatic.jar and I'm getting an error related to "initial heap". Any idea what this is?


java -Xmx500 -jar trimmomatic.jar PE -threads 20 -phred33 ../ERR318658.1.fastq ../ERR318658.2.fastq ERR318658.1_kneaddata.trimmed.1.fastq ERR318658.1_kneaddata.trimmed.single.1.fastq ERR318658.1_kneaddata.trimmed.2.fastq ERR318658.1_kneaddata.trimmed.single.2.fastq
Error:
Error occurred during initialization of VM
Too small initial heap


Answered by Anil Mer

This value must be a multiple of 1024 greater than 2MB.


and

Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes.

So you should get better results with -Xmx500m because -Xmx500 means you launch the JVM with max memory of 500 bytes, which is far too small a running heap AND not a multiple of 1024 !



Your Answer

Interviews

Parent Categories