beast-dev / beast-mcmc

Bayesian Evolutionary Analysis Sampling Trees
http://beast.community
GNU Lesser General Public License v2.1
192 stars 73 forks source link

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

Closed weipenegHU closed 1 year ago

weipenegHU commented 4 years ago

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)

relax991212 commented 2 years ago

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

rambaut commented 1 year ago

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

liamxg commented 1 year ago

reset the xml file file for <= 10000 trees?

rambaut commented 1 year ago

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

liamxg commented 1 year ago

got it, thanks.