HADOOP-6279. Add Runtime::maxMemory to JVM metrics. Contributed by Todd Lipcon
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@823271 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
710d517768
commit
b903b25072
|
@ -15,6 +15,9 @@ Trunk (unreleased changes)
|
|||
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
|
||||
|
|
|
@ -104,10 +104,13 @@ public class JvmMetrics implements Updater {
|
|||
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() {
|
||||
|
|
Loading…
Reference in New Issue