From c73334a924d2009d136a8ee62278aaac53418a24 Mon Sep 17 00:00:00 2001 From: Lukas Majercak Date: Thu, 14 Nov 2019 09:54:02 -0800 Subject: [PATCH] HADOOP-16705. MBeanInfoBuilder puts unnecessary memory pressure on the system with a debug log. MBeanInfoBuilder's get() method DEBUG logs all the MBeanAttributeInfo attributes that it gathered. This can have a high memory churn that can be easily avoided. --- .../java/org/apache/hadoop/metrics2/impl/MBeanInfoBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MBeanInfoBuilder.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MBeanInfoBuilder.java index 528211913d..cdd0ba4275 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MBeanInfoBuilder.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MBeanInfoBuilder.java @@ -106,7 +106,7 @@ MBeanInfo get() { } ++curRecNo; } - MetricsSystemImpl.LOG.debug(attrs.toString()); + MetricsSystemImpl.LOG.debug("{}", attrs); MBeanAttributeInfo[] attrsArray = new MBeanAttributeInfo[attrs.size()]; return new MBeanInfo(name, description, attrs.toArray(attrsArray), null, null, null); // no ops/ctors/notifications