From 071ecbceb65b4207d9ce866ffc0aa31d200d35ef Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 25 Sep 2012 11:19:15 +0100 Subject: [PATCH] JAL-1173 try to catch OOMs when loading annotation onto alignment (need JAL-1176) to recover from these problems --- src/jalview/gui/AlignFrame.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 97829d4..8396e6a 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4976,6 +4976,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { ex.printStackTrace(); } + catch (OutOfMemoryError oom) + { + try { + System.gc(); + } catch (Exception x){}; + new OOMWarning("loading data "+(protocol!=null ? (protocol.equals(FormatAdapter.PASTE) ? "from clipboard." : "using "+protocol+" from "+file) : ".")+(format!=null ? "(parsing as '"+format+"' file)" :""), oom, Desktop.desktop); + } } @Override -- 1.7.10.2