[Jarspy-commits] CVS: JarSpy/src/com/ociweb/gui MemoryMeter.java,1.7,1.8
Status: Beta
Brought to you by:
brown_j
|
From: Jeff B. <br...@us...> - 2002-09-29 20:58:43
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv21600
Modified Files:
MemoryMeter.java
Log Message:
execute gc code outside of event thread
Index: MemoryMeter.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/MemoryMeter.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** MemoryMeter.java 18 Sep 2002 22:47:33 -0000 1.7
--- MemoryMeter.java 29 Sep 2002 20:58:40 -0000 1.8
***************
*** 73,76 ****
--- 73,81 ----
/**
+ * a runnable that is executed each time the user clicks the "gc" menu
+ */
+ private Runnable gcRunnable;
+
+ /**
* default constructor uses DEFAULT_REFRESH_INTERVAL
*/
***************
*** 94,97 ****
--- 99,110 ----
}
};
+
+ gcRunnable = new Runnable() {
+ public void run() {
+ System.runFinalization();
+ System.gc();
+ SwingUtilities.invokeLater(updateRunnable);
+ }
+ };
setupPopupMenu();
}
***************
*** 103,109 ****
mi.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
! System.runFinalization();
! System.gc();
! SwingUtilities.invokeLater(updateRunnable);
}
});
--- 116,120 ----
mi.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
! new Thread(gcRunnable).start();
}
});
|