DamageProfiler icon indicating copy to clipboard operation
DamageProfiler copied to clipboard

OutOfMemoryError: Java heap space

Open lczech opened this issue 5 years ago • 6 comments

Hi there!

I am using DamageProfiler 1.1 via the conda package, which means that the call to run the command line version simply is

damageprofiler [options]

instead of the call

java -jar DamageProfiler-VERSION.jar [options]

that is given in the documentation.

Now, for some large datasets, I am getting

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

and my guess after a bit of searching is that I need to provide Java with

-Xmx<amount of memory>

for this to work (NB: WTF Java?! Just use the available memory!).

My questions here are: Is that indeed the solution to the issue? And if so, how do I provide this with the conda version? Trying to locate the jar file within the conda env directory does not seem like a robust idea - what is the canonical way of solving this?

Thanks in advance and so long Lucas

lczech avatar Nov 18 '20 20:11 lczech

Hi Lucas, sorry for the late reply. Actually, that's the way I usually solve this issue ;)

However, you can try to increase the general JVM heap space used for java applications (However, I'm not sure if this also works for the conda package): export _JAVA_OPTIONS="-Xms512m -Xmx1024m"

Let me know if that works! I'll try to find another/an additional solution. Or @jfy133 do you have any idea?

JudithNeukamm avatar Nov 23 '20 16:11 JudithNeukamm

I'm pretty sure I've done it somehow inthe past but can't remember atm.

At least the python script used with the damageprofiler variable, that calls the jar includes the following line:

https://github.com/bioconda/bioconda-recipes/blob/73395171feca2b41f495c660b91964d5e70f7d1e/recipes/damageprofiler/damageprofiler.py#L16

I guess 'default' would imply it's changeable, but won't be able to check until tomorrow. @apeltzer has more bioconda experience though!

jfy133 avatar Nov 23 '20 17:11 jfy133

Quickly looking at the script, maybe try damageprofiler -Xm 000g?

Regardless, congrats on having so many read s;) b

jfy133 avatar Nov 23 '20 17:11 jfy133

Linking to an issue in one of my other pipelines for bacterial assembly, where we had similar issues: https://github.com/nf-core/bacass/issues/28

Recommendation was to simply replace it - see here https://github.com/bioconda/bioconda-recipes/issues/24749

e.g. a damageprofiler -Xmx64g could already do the trick maybe?

apeltzer avatar Nov 23 '20 17:11 apeltzer

Hi @lczech
could this solve your problem?

JudithNeukamm avatar Dec 08 '20 10:12 JudithNeukamm

Hi @JudithNeukamm,

thanks for the follow up. Unfortunately, I did not yet get back to that project, so as of now, I don't know whether that solution works. I'll post here once I know.

Thank you and all the best Lucas

lczech avatar Dec 20 '20 19:12 lczech