From e1124a62486322d2d28482529d2d6b850ce1719b Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 14 Sep 2005 12:40:29 +0000 Subject: [PATCH] OutOfMemory try catch --- src/jalview/gui/AlignmentPanel.java | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 1358257..f6e6114 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -860,7 +860,22 @@ public class AlignmentPanel extends GAlignmentPanel pg.flush(); pg.close(); - } + } + catch (OutOfMemoryError err) + { + System.out.println("########################\n" + + "OUT OF MEMORY " + epsFile + "\n" + + "########################"); + + JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Out of memory creating EPS file!!" + + + "\nSee help files for increasing Java Virtual Machine memory." + , "Out of memory", + JOptionPane.WARNING_MESSAGE); + System.out.println("Create EPS: " + err); + System.gc(); + } catch (Exception ex) { ex.printStackTrace(); @@ -1007,12 +1022,21 @@ public class AlignmentPanel extends GAlignmentPanel ImageIO.write(bi, "png", out); out.close(); } - catch(OutOfMemoryError err) + catch (OutOfMemoryError err) { System.out.println("########################\n" - +"OUT OF MEMORY "+pngFile+"\n" - +"########################"); + + "OUT OF MEMORY " + pngFile + "\n" + + "########################"); + + JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Out of memory creating PNG!!" + + + "\nSee help files for increasing Java Virtual Machine memory." + , "Out of memory", + JOptionPane.WARNING_MESSAGE); + System.out.println("Create PNG: " + err); System.gc(); + } catch (Exception ex) { -- 1.7.10.2