首页 > 代码库 > Linux运行Java出现“Exception in thread "main" java.lang.OutOfMemoryError: Java heap space”报错

Linux运行Java出现“Exception in thread "main" java.lang.OutOfMemoryError: Java heap space”报错

在运行如下程序时出现“Exception in thread "main" java.lang.OutOfMemoryError: Java heap space”报错:

java  -jar picard.jar SortVcf     I=hg19.sites.vcf     O=hg19.sites.sorted.vcf  SEQUENCE_DICTIONARY=hg19.dict

  出现这种报错说明内存不足。因此我们可以加上“-Xmx”参数

java  -Xmx60g -jar picard.jar SortVcf     I=hg19.sites.vcf     O=hg19.sites.sorted.vcf  SEQUENCE_DICTIONARY=hg19.dict

  

Linux运行Java出现“Exception in thread "main" java.lang.OutOfMemoryError: Java heap space”报错