From: tcofoegbu Date: Tue, 9 Feb 2016 13:11:08 +0000 (+0000) Subject: JAL-1976 catch and handle OOM Error X-Git-Tag: Release_2_10_0~312 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=25217bbd06c4435ad995fd8ddf3620c3b1d68cd3;p=jalview.git JAL-1976 catch and handle OOM Error --- diff --git a/src/jalview/io/BioJsHTMLOutput.java b/src/jalview/io/BioJsHTMLOutput.java index 9454cae..f8fa1f5 100644 --- a/src/jalview/io/BioJsHTMLOutput.java +++ b/src/jalview/io/BioJsHTMLOutput.java @@ -25,6 +25,7 @@ import jalview.api.AlignmentViewPanel; import jalview.datamodel.AlignmentExportData; import jalview.exceptions.NoFileSelectedException; import jalview.gui.IProgressIndicator; +import jalview.gui.OOMWarning; import jalview.json.binding.biojs.BioJSReleasePojo; import jalview.json.binding.biojs.BioJSRepositoryPojo; import jalview.util.MessageManager; @@ -81,10 +82,10 @@ public class BioJsHTMLOutput public void exportJalviewAlignmentAsBioJsHtmlFile() { + String outputFile = null; try { - String outputFile = getOutputFile(); - // String jalviewAlignmentJson = JSONFile.getJSONData(ap); + outputFile = getOutputFile(); AlignExportSettingI exportSettings = new AlignExportSettingI() { @Override @@ -151,6 +152,11 @@ public class BioJsHTMLOutput } catch (NoFileSelectedException ex) { // do noting if no file was selected + } catch (OutOfMemoryError err) + { + System.out.println("########################\n" + "OUT OF MEMORY " + + outputFile + "\n" + "########################"); + new OOMWarning("Creating Image for " + outputFile, err); } catch (Exception e) { pIndicator.setProgressBar(MessageManager.formatMessage( diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java index b53cacd..e554b8e 100644 --- a/src/jalview/io/HtmlSvgOutput.java +++ b/src/jalview/io/HtmlSvgOutput.java @@ -28,6 +28,7 @@ import jalview.gui.AlignViewport; import jalview.gui.AlignmentPanel; import jalview.gui.HTMLOptions; import jalview.gui.IProgressIndicator; +import jalview.gui.OOMWarning; import jalview.math.AlignmentDimension; import jalview.util.MessageManager; @@ -204,6 +205,11 @@ public class HtmlSvgOutput pIndicator.setProgressBar(MessageManager.formatMessage( "status.export_complete", "HTML"), pSessionId); } + } catch (OutOfMemoryError err) + { + System.out.println("########################\n" + "OUT OF MEMORY " + + file + "\n" + "########################"); + new OOMWarning("Creating Image for " + file, err); } catch (Exception e) { e.printStackTrace();