Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.OutOfMemoryError: Java heap space #1221

Closed
ghost opened this issue Aug 29, 2018 · 4 comments
Closed

java.lang.OutOfMemoryError: Java heap space #1221

ghost opened this issue Aug 29, 2018 · 4 comments

Comments

@ghost
Copy link

@ghost ghost commented Aug 29, 2018

Bug Report

Affected tool(s)

Mark Duplicates

Affected version(s)

Picard version: 2.18.11
Using Java 8u151

Description

The error I keep getting is:

INFO 2018-08-29 11:58:12 MarkDuplicates Tracking 2186445 as yet unmatched pairs. 117336 records in RAM.
INFO 2018-08-29 11:58:21 MarkDuplicates Read 489,000,000 records. Elapsed time: 00:58:09s. Time for last 1,000,000: 8s. Last read position: chr8:15,392,138
INFO 2018-08-29 11:58:21 MarkDuplicates Tracking 2186162 as yet unmatched pairs. 114912 records in RAM.
[Wed Aug 29 11:58:39 AEST 2018] picard.sam.markduplicates.MarkDuplicates done. Elapsed time: 58.48 minutes.
Runtime.totalMemory()=954728448
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.newArray(Native Method)
at java.lang.reflect.Array.newInstance(Array.java:75)
at java.util.Arrays.parallelSort(Arrays.java:1178)
at htsjdk.samtools.util.SortingCollection.spillToDisk(SortingCollection.java:248)
at htsjdk.samtools.util.SortingCollection.add(SortingCollection.java:183)
at picard.sam.markduplicates.MarkDuplicates.buildSortedReadEndLists(MarkDuplicates.java:590)
at picard.sam.markduplicates.MarkDuplicates.doWork(MarkDuplicates.java:232)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:277)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)

Steps to reproduce

I am using the command:
java -Xmx60g -jar picard.jar MarkDuplicates
INPUT=$BAM_DIR$TUMOR$SORTED
OUTPUT=$BAM_DIR$TUMOR$SUFFIX
METRICS_FILE=$BAM_DIR$TUMOR$SUFFIX.metrics.txt
VALIDATION_STRINGENCY=LENIENT
TMP_DIR=$TMP_DIR

Expected behavior

I ran this exact bam file through 1 month ago with 8gb, same parameters and no problems.

Actual behavior

As above

Thank you for you help!

@yfarjoun
Copy link
Contributor

@yfarjoun yfarjoun commented Aug 29, 2018

Loading

@ghost
Copy link
Author

@ghost ghost commented Nov 29, 2018

Done, thank you!

Loading

@ghost ghost closed this Nov 29, 2018
@YONG-JIA
Copy link

@YONG-JIA YONG-JIA commented Jun 1, 2019

Hi,
I encountered the same issue, do you mind illustrate how to "Try lowering the records in RAM argument" ? Thanks a in advance.

Loading

@wbsimey
Copy link

@wbsimey wbsimey commented Jul 17, 2019

YONG, you can uses the java arg -Xmx2g to increase the amount of memory. I use -Xmx100g on a system with 1TB RAM. Make sure you know how much memory your system has available.
For example:
picard -Xmx100g CollectAlignmentSummaryMetrics ...

Loading

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants