[Swift-commit] r7499 - trunk/src/org/griphyn/vdl/karajan/lib

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Wed Jan 22 16:51:04 CST 2014


Author: hategan
Date: 2014-01-22 16:51:04 -0600 (Wed, 22 Jan 2014)
New Revision: 7499

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java
Log:
added code to regularly log memory usage of the swift process

Modified: trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java	2014-01-22 22:43:49 UTC (rev 7498)
+++ trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java	2014-01-22 22:51:04 UTC (rev 7499)
@@ -288,7 +288,7 @@
 				}
 			}
 		}
-				
+		
 		void shutdown() {
 		    shutdown = true;
 		}
@@ -379,6 +379,16 @@
 			    logger.info(msg);
 			}
 			
+			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);
+			}
+			
 			return true;
 		}
 




More information about the Swift-commit mailing list