[Swift-commit] cog r3863

swift at ci.uchicago.edu swift at ci.uchicago.edu
Wed Jan 22 21:20:05 CST 2014


------------------------------------------------------------------------
r3863 | hategan | 2014-01-22 21:18:07 -0600 (Wed, 22 Jan 2014) | 1 line

added code to regularly log memory usage of the coaster service process
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/CoasterService.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/CoasterService.java	(revision 3862)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/CoasterService.java	(working copy)
@@ -250,6 +250,7 @@
             while (!done) {
                 wait(10000);
                 checkIdleTime();
+                logMemoryUsage();
             }
             if (exceptionAtStop != null) {
                 throw exceptionAtStop;
@@ -257,6 +258,20 @@
         }
     }
 
+    private void logMemoryUsage() {
+        if (!local) {
+            if (logger.isInfoEnabled()) {
+                Runtime r = Runtime.getRuntime();
+                long maxHeap = r.maxMemory();
+                long freeMemory = r.freeMemory();
+                long totalMemory = r.totalMemory();
+                long usedMemory = totalMemory - freeMemory;
+                
+                logger.info("HeapMax: " + maxHeap + ", CrtHeap: " + totalMemory + ", UsedHeap: " + usedMemory);
+            }
+        }
+    }
+
     @Override
     public void irrecoverableChannelError(KarajanChannel channel, Exception e) {
         logger.warn("irrecoverable channel error!\n\t" + e);



More information about the Swift-commit mailing list