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.

(cherry picked from commit c73334a924)
This commit is contained in:
Lukas Majercak 2019-11-14 09:54:02 -08:00 committed by Inigo Goiri
parent 322cef7762
commit 049d061001
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ class MBeanInfoBuilder implements MetricsVisitor {
} }
++curRecNo; ++curRecNo;
} }
MetricsSystemImpl.LOG.debug(attrs.toString()); MetricsSystemImpl.LOG.debug("{}", attrs);
MBeanAttributeInfo[] attrsArray = new MBeanAttributeInfo[attrs.size()]; MBeanAttributeInfo[] attrsArray = new MBeanAttributeInfo[attrs.size()];
return new MBeanInfo(name, description, attrs.toArray(attrsArray), return new MBeanInfo(name, description, attrs.toArray(attrsArray),
null, null, null); // no ops/ctors/notifications null, null, null); // no ops/ctors/notifications