hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r823271 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/metrics/jvm/JvmMetrics.java
Date Thu, 08 Oct 2009 18:54:04 GMT
Author: cdouglas
Date: Thu Oct  8 18:54:04 2009
New Revision: 823271

URL: http://svn.apache.org/viewvc?rev=823271&view=rev
Log:
HADOOP-6279. Add Runtime::maxMemory to JVM metrics. Contributed by Todd Lipcon

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/metrics/jvm/JvmMetrics.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=823271&r1=823270&r2=823271&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Thu Oct  8 18:54:04 2009
@@ -15,6 +15,9 @@
     HADOOP-6283. Improve the exception messages thrown by
     FileUtil$HardLink.getLinkCount(..).  (szetszwo)
 
+    HADOOP-6279. Add Runtime::maxMemory to JVM metrics. (Todd Lipcon via
+    cdouglas)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/metrics/jvm/JvmMetrics.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/metrics/jvm/JvmMetrics.java?rev=823271&r1=823270&r2=823271&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/metrics/jvm/JvmMetrics.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/metrics/jvm/JvmMetrics.java Thu Oct  8
18:54:04 2009
@@ -104,10 +104,13 @@
                 memoryMXBean.getNonHeapMemoryUsage();
         MemoryUsage memHeap =
                 memoryMXBean.getHeapMemoryUsage();
+        Runtime runtime = Runtime.getRuntime();
+
         metrics.setMetric("memNonHeapUsedM", memNonHeap.getUsed()/M);
         metrics.setMetric("memNonHeapCommittedM", memNonHeap.getCommitted()/M);
         metrics.setMetric("memHeapUsedM", memHeap.getUsed()/M);
         metrics.setMetric("memHeapCommittedM", memHeap.getCommitted()/M);
+        metrics.setMetric("maxMemoryM", runtime.maxMemory()/M);
     }
     
     private void doGarbageCollectionUpdates() {



Mime
View raw message