This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Pilon cloud error: Java.lang.OutOfMemoryError: Java heap space, how to fix without changing hosting resources?

Pilon cloud error: Java.lang.OutOfMemoryError: Java heap space, how to fix without changing hosting resources?

Fatal error: Exit code 1 ()
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.simontuffs.onejar.Boot.run(Boot.java:340)
    at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: java.lang.OutOfMemoryError: Java heap space
    at org.broadinstitute.pilon.PileUpRegion$$anonfun$1.apply$mcVI$sp(PileUpRegion.scala:29)
    at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160)
    at org.broadinstitute.pilon.PileUpRegion.<init>(PileUpRegion.scala:29)
    at org.broadinstitute.pilon.GenomeRegion.initializePileUps(GenomeRegion.scala:137)
    at org.broadinstitute.pilon.GenomeFile$$anonfun$processRegions$5.apply(GenomeFile.scala:112)
    at org.broadinstitute.pilon.GenomeFile$$anonfun$processRegions$5.apply(GenomeFile.scala:110)
    at scala.collection.Iterator$class.foreach(Iterator.scala:893)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
    at scala.collection.parallel.ParIterableLike$Foreach.leaf(ParIterableLike.scala:972)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply$mcV$sp(Tasks.scala:49)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:48)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:48)
    at scala.collection.parallel.Task$class.tryLeaf(Tasks.scala:51)
    at scala.collection.parallel.ParIterableLike$Foreach.tryLeaf(ParIterableLike.scala:969)
    at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask$class.compute(Tasks.scala:152)
    at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$WrappedTask.compute(Tasks.scala:443)
    at scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:160)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
pilon cloud amazon

2 answers

"If pilon was installed by condo, edit the file "/Users/user/anaconda/bin/pilon" by changing the maximum memory limit from 1G to higher numbers like "14G". It works. " check the thread: https://github.com/broadinstitute/pilon/issues/26

Hello !

I encountered a similar problem (error Java.lang.OutOfMemoryError ), this issue has been reported on github : https://github.com/broadinstitute/pilon/issues/32

As the answer took to long to arrive, I give up Pilon a month ago, but since someone proposed a way to solve this issue. Maybe you can try his answers :

This essentially means your 90G of allocated memory was insufficient. When Java starts getting towards the limit of the memory specified (-Xmx) it starts to perform more aggressive garbage collection (GC) to free up memory. So as to avoid running GC all the time, instead of running computations, Java will kill the command if the total time spent performing GC exceeds a percentage (I think 98% from memory) of total run time. I reality, I think what this means is that if Pilon is running for 2min before it starts to run GC, then the GC would have to run for 98min before the process is killed. The only general Java solution is to increase the amoutn of memory you make available to Java by increasing -Xmx.

Hope it will help you !

Well, I guess I somehow misunderstand the question ?

No that's a reply typical for this user. Don't take it personal.

Ah okay, I won't then. Thanks for telling me !

You can ask me any questions anytime in turn

If an answer was helpful, upvote it. If it resolved your question, accept the answer to mark this thread as answered.

What if: 90G of allocated memory is the only amount of memory available and I cannot increase the amount. What should I do then?

A little background, I am trying to run a java command on cluster and even if I increase the memory it is still giving me this error.

Log in to answer this question.