Skip to content

Commit

Permalink
add more sensible OutOfMemmoryError messages to TreeAnotator CompEvol…
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Nov 18, 2024
1 parent e1a12a3 commit 1c81562
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/beastfx/app/treeannotator/TAGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public void run() {

} catch (Exception ex) {
Log.err.println("Exception: " + ex.getMessage());
} catch (OutOfMemoryError e) {
Log.warning("TreeAnnotator ran out of memory: " + e.getMessage());
Log.warning("You can subsample the tree set with LogCombiner or provide more memory to fix this.");
Log.warning("See https://www.beast2.org/increasing-memory-usage/ on how to provide more memory");
}

TreeAnnotator.progressStream.println("Finished - Quit program to exit.");
Expand Down
20 changes: 13 additions & 7 deletions src/beastfx/app/treeannotator/TreeAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1333,13 +1333,19 @@ public static void main(String[] args) throws Exception {
return;
}

TreeAnnotator annotator = new TreeAnnotator();
Application app = new Application(annotator);
annotator.filesInput.determineClass(annotator);
app.setDefaultInput(annotator.filesInput);
app.parseArgs(args, true);
annotator.initAndValidate();
annotator.run();
try {
TreeAnnotator annotator = new TreeAnnotator();
Application app = new Application(annotator);
annotator.filesInput.determineClass(annotator);
app.setDefaultInput(annotator.filesInput);
app.parseArgs(args, true);
annotator.initAndValidate();
annotator.run();
} catch (OutOfMemoryError e) {
Log.warning("TreeAnnotator ran out of memory: " + e.getMessage());
Log.warning("You can subsample the tree set with LogCombiner or provide more memory to fix this.");
Log.warning("See https://www.beast2.org/increasing-memory-usage/ on how to provide more memory");
}
}

@Override
Expand Down

0 comments on commit 1c81562

Please sign in to comment.