Re: TreeAnnotator java.lang.OutOfMemoryError: Java heap space

3,717 views
Skip to first unread message

pawan jayaswal

unread,
Nov 27, 2013, 7:13:39 AM11/27/13
to beast...@googlegroups.com
Hey, Meng did u get any solution for you querry? If yes Plz also forward to me bcz I am also facing issue.....

On Tuesday, 16 October 2012 08:47:55 UTC+5:30, meng shengli wrote:

I keep getting an out of memory warning when trying to use 
TreeAnnotator.  This is a large run(Trees 11.6gb). 

I have tried increasing the memory allocated to Java and this is the error that I got on my last attempt.

Any suggestions? If you know please tell me through figure, which will show how I should do.


My computer

Windows 7 version

CPU:
Intel(R)Core(TM)i3-2330M cpu @ 2.20GHz 2.20GHz
RAM:4.00GB(2.92 GM USE)
system:32


 
 

Highest Log Clade Credibility: -200.21090323098244
Collecting node information...
0              25             50             75            100
|--------------|--------------|--------------|--------------|
 *********************************Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
 at java.util.regex.Pattern.compile(Unknown Source)
 at java.util.regex.Pattern.<init>(Unknown Source)
  at java.util.regex.Pattern.compile(Unknown Source)
 at java.lang.String.replaceAll(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributesForClade(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
  at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
  at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
  at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
  at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
 at dr.app.tools.TreeAnnotator$CladeSystem.collectAttributes(Unknown Source)
 at dr.app.tools.TreeAnnotator.<init>(Unknown Source)
  at dr.app.tools.TreeAnnotator.main(Unknown Source)

 
Would YOU please leave me a suggestion? If you know please tell me through figure, which will show how I should do.
 
 
 
Thank you very much!
 
 
 
Meng  shengli

Ingo Michalak

unread,
Nov 27, 2013, 11:20:46 AM11/27/13
to beast...@googlegroups.com
Hi together,

try to subsample your trees file (e.g. using LogCombiner). 10,000 trees are usually sufficient/recommended.

Good luck!

pawan jayaswal

unread,
Nov 29, 2013, 1:32:54 AM11/29/13
to beast...@googlegroups.com
Dear Ian,
 
  Thank you very much for your valuable suggestion but Still it is not working in my case and I am getting same error. DO u lyk to say sm thing.........

Santiago Sanchez

unread,
Nov 29, 2013, 11:18:26 AM11/29/13
to beast...@googlegroups.com
Hello pawan,

You basically need to run treeannotator with a memory allocation above your tree file size. You can probably use a CPU cluster with lots for memory. If you try to run a 11 GB tree file in treeannotator with a computer that has 4 GB of memory, you will not be able to successfully finish the run because of memory shortage, no matter what memory allocation you give to java.

Cheers,
Santiago

Santiago Sanchez-Ramirez
Ecology and Evolutionary Biology, University of Toronto
Natural History (Mycology), Royal Ontario Museum
100 Queen's Park
Toronto, ON
M5S 2C6
Canada
--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at http://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/groups/opt_out.

pawan jayaswal

unread,
Dec 2, 2013, 7:03:59 AM12/2/13
to beast...@googlegroups.com
Dear Santiago,

  Thank you very much for your reply. At present  I am having ~ 4 Gb of tree and 120 GB RAM. But still I am facing memory related issue  with Java. I will really thankful if you will be provide some kind of solution for this.


With Regrds

Pawan

Ingo Michalak

unread,
Dec 2, 2013, 7:40:46 AM12/2/13
to beast...@googlegroups.com
Hi Pawan,
In the folder BEAST/bin you find an executable script for TreeAnnotator, which you can open in a text editor for modifications. There you can change the amount of memory allocated to (the java instance hosting) TreeAnnotator. Increase the value to more than your trees file's size and run this very script to start TreeAnnotator. 

Good luck!

Santiago Sanchez

unread,
Dec 2, 2013, 8:38:37 AM12/2/13
to beast...@googlegroups.com
Hi Pawan,

If you try to run treeannotator command line with:

java -Xmx6144M -Xms6144M -cp beast.jar dr.app.tools.TreeAnnotator -burnin #### mytrees.trees mymcc.tre

Does it still give you a memory error?

Cheers,
Santiago

Santiago Sanchez-Ramirez
Ecology and Evolutionary Biology, University of Toronto
Natural History (Mycology), Royal Ontario Museum
100 Queen's Park
Toronto, ON
M5S 2C6
Canada

pawan jayaswal

unread,
Dec 2, 2013, 8:56:36 AM12/2/13
to beast...@googlegroups.com
Dear Ingo & Santiago,

Yes, I have changed the memory allocated to  treeannotator in bin file. like 


@echo off
setlocal
if ""=="%BEAST%" set BEAST=%~dp0%..
set BEAST_LIB=%BEAST%\lib
java -Xms6144m -Xmx6144m -Djava.library.path="%BEAST_LIB%" -cp "%BEAST_LIB%/beast.jar" dr.app.tools.TreeAnnotator %*



After change, Still i m getting same memory related error. Infact I allocated upto 50 GB memory but the thing is same, Ian. 

Santiago, I have run this through command promt but not  get success.


I hope grp will suggest me sm thing which will work..

Still  i m waiting.


Pawan

Andrew Rambaut

unread,
Dec 2, 2013, 9:27:09 AM12/2/13
to beast...@googlegroups.com
Dear Pawan, Ingo & Santiago,

It is not as simple as giving the program enough memory to fit the size of the tree file. If the trees are very variable then the memory required to store all the clades and the data may be much more. I suggest down sampling the tree file to fewer trees using logcombiner. How many sequences are in your trees? How many trees are in the tree file (how long are your chains and how frequently are you sampling)?

Andrew
signature.asc

pawan jayaswal

unread,
Dec 2, 2013, 11:42:25 PM12/2/13
to beast...@googlegroups.com
Dear Rambaut,

Case1.
 
   I have used logcompiler option also. Tree file size is 1.9 GB after passing through logcompiler it become 222MB after that I passed this logcompiler file (i.e.222MB) through tree-annotator, it generated 422 MB file. But this file is not responded by figtree.

Case2.

When I tried to run this file in cmd, I got error like could not find or load main class  dr.app.tools.Treeannotator. Would u like to suggest how to run this in command prompt.

Pawan 
Reply all
Reply to author
Forward
0 new messages