beast-mcmc icon indicating copy to clipboard operation
beast-mcmc copied to clipboard

Java.lang.OutOfMemoryError: Requested array size exceeds VM limit

Open weipenegHU opened this issue 3 years ago • 1 comments

I came across this problem when running the TreeAnnotator. I have changed the -Xmx of TreeAnnotator to 10GB but it did not work. Here are some information that may be helpful.

input tree size: 3.2G Burn in: 1,000,000 states Targe tree type: Maximum clade credibility tree Node heights: Median heights

***Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit at java.base/java.util.Arrays.copyOf(Arrays.java:3745) at java.base/java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:172) at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:748) at java.base/java.lang.StringBuffer.append(StringBuffer.java:424) at dr.evolution.io.Importer.skipComments(Unknown Source) at dr.evolution.io.Importer.readCharacter(Unknown Source) at dr.evolution.io.Importer.nextCharacter(Unknown Source) at dr.evolution.io.Importer.readToken(Unknown Source) at dr.evolution.io.Importer.readDouble(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source) at dr.evolution.io.NexusImporter.readInternalNode(Unknown Source) at dr.evolution.io.NexusImporter.readBranch(Unknown Source)

weipenegHU avatar Jul 23 '20 02:07 weipenegHU

Hello, I also encountered the same problem, how do you solve it later

relax991212 avatar Apr 14 '22 08:04 relax991212

You will likely need much more than 10GB to load this tree file. I suggest down sampling it first using LogCombiner.

rambaut avatar Aug 15 '23 14:08 rambaut

reset the xml file file for <= 10000 trees?

liamxg avatar Aug 15 '23 23:08 liamxg

That won't be necessary. Use LogCombiner in the BEAST package to resample your existing log files to a sparser sample. https://beast.community/logcombiner

rambaut avatar Aug 16 '23 08:08 rambaut

got it, thanks.

liamxg avatar Aug 16 '23 08:08 liamxg