java.lang.OutOfMemoryError, Mark Duplicates in Picard indexer builder

I encountered the same error as described in the link below:

This is a closed topic in github. The answer provided in github is not clear to me, could anyone explain to me how to solve the problem in details? Thanks in advance.

Picard (or parts or it - I don’t know) is written in JAVA.

Your error is a kind of “out of memory” error. So, your galaxy administrator needs to give the picard job more memory, and probably set the -Xmx parameter of Java.

From a system/Galaxy administrator point of view java programs are horrible, since finding memory setting that work all cases is a nearly impossible task. The JAVA programming language somehow seems to delegate memory management from the programmers (who should care … but essentially can’t in Java) to the admins.

So my suggestion is to bother your admins or to switch to a non-java alternative like samtools.

Btw. it would have been nice to mention the link to the github discussion.

Thanks Bernt for the reply. I spent a whole day digging around my local galaxy files, and finally fixed the error.
You are right, picard is written in java “picard.jar”, when running picard indexer in galaxy, the java program is called in a file called “picard” installed in the galaxy dependency folder. In this “picard” file, it states when no option is given when running the java program (the picard indexer in galaxy have no input choice for picard.jar program), the maximum memory “default_jvm_mem_opts” is set to “Xmx1g” (1Gb). So after changing it to “Xmx10g”, the error is gone!!!
I guess this is not a problem for people running the picard tool outside galaxy, but within galaxy the picard indexer tool is installed with a default memory size of 1Gb only.