generating ,hic for big files: java heap space error

228 views
Skip to first unread message

Zhang Cheng

unread,
Sep 1, 2020, 3:55:01 PM9/1/20
to 3D Genomics
Hi, 

I was trying to generate a few big .hic files, but encounter the `java.lang.OutOfMemoryError: Java heap space` error .


1. I was using pbs and requested 128gb mem 

2. I exported java options as suggested by the previous conversations in the group 

The full log is here: 


+Mon Aug 31+13:58:38 export 'IBM_JAVA_OPTIONS=-Xmx49152m -Xgcthreads1'
+Mon Aug 31+13:58:38 IBM_JAVA_OPTIONS='-Xmx49152m -Xgcthreads1'
+Mon Aug 31+13:58:38 export '_JAVA_OPTIONS=-Xmx49152m -Xms49152m'
+Mon Aug 31+13:58:38 _JAVA_OPTIONS='-Xmx49152m -Xms49152m'
+Mon Aug 31+13:58:38 juiceDir=/home/zhc268/scratch/juicer/scripts/common
+Mon Aug 31+13:58:38 /home/zhc268/scratch/juicer/scripts/common/juicer_tools pre -s /home/zhc268/scratch/juicer/work/RMM_307_1_2_3_RMM_308_1_2_3/mega/aligned//inter.txt -g /home/zhc268/scratch/juicer/work/RMM_307_1_2_3_RMM_308_1_2_3/mega/aligned//inter_hists.m -q 1 /home/zhc268/scratch/juicer/work/RMM_307_1_2_3_RMM_308_1_2_3/mega/aligned//merged_nodups.txt /home/zhc268/scratch/juicer/work/RMM_307_1_2_3_RMM_308_1_2_3/mega/aligned//inter.hic hg19
Picked up _JAVA_OPTIONS: -Xmx49152m -Xms49152m
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.base/java.util.Arrays.copyOf(Arrays.java:3689)
        at java.base/java.util.ArrayList.grow(ArrayList.java:237)
        at java.base/java.util.ArrayList.grow(ArrayList.java:242)
        at java.base/java.util.ArrayList.add(ArrayList.java:485)
        at java.base/java.util.ArrayList.add(ArrayList.java:498)
        at juicebox.tools.utils.norm.GenomeWideNormalizationVectorUpdater.createWholeGenomeRecords(GenomeWideNormalizationVectorUpdater.java:207)
        at juicebox.tools.utils.norm.GenomeWideNormalizationVectorUpdater.getWGVectors(GenomeWideNormalizationVectorUpdater.java:134)
        at juicebox.tools.utils.norm.GenomeWideNormalizationVectorUpdater.updateHicFileForGWfromPreOnly(GenomeWideNormalizationVectorUpdater.java:226)
        at juicebox.tools.utils.norm.NormalizationVectorUpdater.updateHicFile(NormalizationVectorUpdater.java:76)
        at juicebox.tools.clt.old.PreProcessing.run(PreProcessing.java:126)
        at juicebox.tools.HiCTools.main(HiCTools.java:96)

The size of input `merged_nodups.txt` is 

822G Aug 26 18:30 /home/zhc268/scratch/juicer/work/RMM_307_1_2_3_RMM_308_1_2_3/mega/aligned//merged_nodups.txt


Do you have any suggestions? 

Best 
Frank

Zhang Cheng

unread,
Sep 1, 2020, 3:58:40 PM9/1/20
to 3D Genomics
The output logs are: 


WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
WARN [2020-08-31T13:58:39,546]  [Globals.java:138] [main]  Development mode is enabled
Not including fragment map
Start preprocess
Writing header
Writing body
......................................................................................................................................................................................................................................................................................................................................
Writing footer

Finished preprocess

Calculating norms for zoom BP_2500000
Calculating norms for zoom BP_1000000
Calculating norms for zoom BP_500000
Calculating norms for zoom BP_250000
Calculating norms for zoom BP_100000
Calculating norms for zoom BP_50000
Calculating norms for zoom BP_25000
Calculating norms for zoom BP_10000


-------------

9.2G Sep  1 02:30 /home/zhc268/scratch/juicer/work/RMM_307_1_2_3_RMM_308_1_2_3/mega/aligned/inter.hic 

inter.hic was generated but without KR normalization info. When dump KR norm, it shows `Norm KR missing`

Muhammad Saad Shamim

unread,
Sep 1, 2020, 4:06:31 PM9/1/20
to Zhang Cheng, 3D Genomics
Hey Frank,

It seems as though the java lines weren't updated to use 128GB, so the JVM was still 50GB or so.
You'll need to update the JAVA_OPTIONS and juicertools script to use -Xmx128g etc.

Best,


--
You received this message because you are subscribed to the Google Groups "3D Genomics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 3d-genomics...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/3d-genomics/08c2e836-9989-4c3e-a4e6-bc0e309d135fo%40googlegroups.com.

Zhang Cheng

unread,
Sep 1, 2020, 4:44:15 PM9/1/20
to Muhammad Saad Shamim, 3D Genomics
Hi Muhammad, 

Thanks for your reply. 

Are you suggesting to increase JVM from 50gb to 128gb etc? I can try that. 

Do you have any idea what's the minimal JVM mem  given a 822G merge_nodup.txt? I've try 16gb, 64gb but all failed in KR norm. 

Sorry for the confusion, 128gb was what I requested from pbs clusters and not the JVM mem. I am going to try a bigger JVM mem as you suggested. 

Best 
Frank
Zhang (Frank) Cheng






Tom

unread,
Aug 4, 2021, 1:55:35 PM8/4/21
to 3D Genomics
Hi Frank,

Have you solved this problem? I was stuck with the same problem and still don't know the proper way to fix it.

Thanks,
T

Reply all
Reply to author
Forward
0 new messages