[Swift-commit] cog r3864

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


------------------------------------------------------------------------
r3864 | hategan | 2014-01-22 21:20:01 -0600 (Wed, 22 Jan 2014) | 1 line

moved memory logging code to a place that makes more sense
------------------------------------------------------------------------
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 3863)
+++ 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(CoasterChannel channel, Exception e) {
         logger.warn("irrecoverable channel error!\n\t" + e);
@@ -504,6 +519,4 @@
     public void setDefaultQP(String defaultQP) {
         this.defaultQP = defaultQP;
     }
-
-
 }
Index: modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java	(revision 3863)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java	(working copy)
@@ -148,16 +148,6 @@
                 synchronized (incoming) {
                     incoming.wait(Math.min(planTimeMillis * 20, 10000) + 1000);
                 }
-                
-                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);
-                }
             }
             if (shuttingDown) {
                 logger.info("Service shutting down. Exiting planning loop.");



More information about the Swift-commit mailing list