git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b6f7fc8
)
stop multiple dialogs appearing one after another (in progress for JAL-414)
author
jprocter
<Jim Procter>
Mon, 14 Jun 2010 12:47:21 +0000
(12:47 +0000)
committer
jprocter
<Jim Procter>
Mon, 14 Jun 2010 12:47:21 +0000
(12:47 +0000)
src/jalview/gui/OOMWarning.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/OOMWarning.java
b/src/jalview/gui/OOMWarning.java
index
3f2b5a8
..
48db5d9
100644
(file)
--- a/
src/jalview/gui/OOMWarning.java
+++ b/
src/jalview/gui/OOMWarning.java
@@
-25,6
+25,8
@@
public class OOMWarning implements Runnable
\r
String instructions = "";
\r
\r
\r
String instructions = "";
\r
\r
+ public static boolean oomInprogress = false;
\r
+
\r
Component desktop = null;
\r
\r
/**
\r
Component desktop = null;
\r
\r
/**
\r
@@
-40,22
+42,27
@@
public class OOMWarning implements Runnable
OOMWarning(final String action, final OutOfMemoryError oomex,
\r
final Component instance)
\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
{
\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
{
\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
}
\r
+ javax.swing.SwingUtilities.invokeLater(this);
\r
+ System.gc();
\r
}
\r
}
\r
- javax.swing.SwingUtilities.invokeLater(this);
\r
- System.gc();
\r
}
\r
\r
public OOMWarning(String string, OutOfMemoryError oomerror)
\r
}
\r
\r
public OOMWarning(String string, OutOfMemoryError oomerror)
\r
@@
-74,6
+81,8
@@
public class OOMWarning implements Runnable
+ "\nSee help files for increasing Java Virtual Machine memory.",
\r
"Out of memory",
\r
javax.swing.JOptionPane.WARNING_MESSAGE);
\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
}
\r
\r
}
\r