From: jprocter Date: Tue, 25 Sep 2012 10:19:15 +0000 (+0100) Subject: JAL-1173 try to catch OOMs when loading annotation onto alignment (need JAL-1176... X-Git-Tag: Jalview_2_9~295 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=071ecbceb65b4207d9ce866ffc0aa31d200d35ef;p=jalview.git JAL-1173 try to catch OOMs when loading annotation onto alignment (need JAL-1176) to recover from these problems --- 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