JAL-1173 try to catch OOMs when loading annotation onto alignment (need JAL-1176...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 25 Sep 2012 10:19:15 +0000 (11:19 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 25 Sep 2012 10:19:15 +0000 (11:19 +0100)
src/jalview/gui/AlignFrame.java

index 97829d4..8396e6a 100755 (executable)
@@ -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