\r
String instructions = "";\r
\r
+ public static boolean oomInprogress = false;\r
+\r
Component desktop = null;\r
\r
/**\r
OOMWarning(final String action, final OutOfMemoryError oomex,\r
final Component instance)\r
{\r
- this.action = action;\r
- desktop = instance;\r
- if (oomex != null)\r
+ if (!oomInprogress)\r
{\r
- if (jalview.bin.Cache.log != null)\r
- {\r
- jalview.bin.Cache.log.error("Out of Memory when " + action, oomex);\r
- }\r
- else\r
+ oomInprogress = true;\r
+ this.action = action;\r
+ desktop = instance;\r
+ if (oomex != null)\r
{\r
- System.err.println("Out of Memory when " + action);\r
- oomex.printStackTrace();\r
+ if (jalview.bin.Cache.log != null)\r
+ {\r
+ jalview.bin.Cache.log\r
+ .error("Out of Memory when " + action, oomex);\r
+ }\r
+ else\r
+ {\r
+ System.err.println("Out of Memory when " + action);\r
+ oomex.printStackTrace();\r
+ }\r
}\r
+ javax.swing.SwingUtilities.invokeLater(this);\r
+ System.gc();\r
}\r
- javax.swing.SwingUtilities.invokeLater(this);\r
- System.gc();\r
}\r
\r
public OOMWarning(String string, OutOfMemoryError oomerror)\r
+ "\nSee help files for increasing Java Virtual Machine memory.",\r
"Out of memory",\r
javax.swing.JOptionPane.WARNING_MESSAGE);\r
+ // hope that there's enough memory left that no more appear.\r
+ oomInprogress=false;\r
}\r
\r
}\r