[ https://issues.apache.org/jira/browse/HBASE-15742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15269432#comment-15269432 ]
Hudson commented on HBASE-15742: -------------------------------- FAILURE: Integrated in HBase-Trunk_matrix #890 (See [https://builds.apache.org/job/HBase-Trunk_matrix/890/]) HBASE-15742 Reduce allocation of objects in metrics (Phil Yang) (tedyu: rev f76ffb7f38f003c4e01044eddc5e1d0d970a7efd) * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableHistogram.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/MetricsInfoImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableRangeHistogram.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/Interns.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableSourceImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterProcSourceImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSourceImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/balancer/MetricsStochasticBalancerSourceImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableAggregateSourceImpl.java * hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java > Reduce allocation of objects in metrics > --------------------------------------- > > Key: HBASE-15742 > URL: https://issues.apache.org/jira/browse/HBASE-15742 > Project: HBase > Issue Type: Bug > Affects Versions: 1.3.0, 1.2.1, 1.0.3, 1.1.4, 0.98.19 > Reporter: Phil Yang > Assignee: Phil Yang > Fix For: 2.0.0, 1.3.0, 1.4.0, 1.2.2, 0.98.20 > > Attachments: HBASE-15742-0.98.v1.patch, HBASE-15742-0.98.v2.patch, > HBASE-15742-branch-1-v1.patch, HBASE-15742-branch-1.1-v1.patch, > HBASE-15742-branch-1.2-v1.patch, HBASE-15742-branch-1.2-v2.patch, > HBASE-15742-v1.patch, HBASE-15742-v2.patch, HBASE-15742-v3.patch, > HBASE-15742-v4.patch > > > We use JMX and o.a.h.metrics2 to do some metrics on regions, tables, region > servers and cluster. We use MetricsInfo to show the information of metrics, > and we use Interns to cache MetricsInfo objects because it won't be changed. > However, in Interns there are some static values to limit the max cached > objects. We can only cache 2010 metrics, but we have dozens of metrics for > one region and we have some RS-level metrics in each RS and all metrics for > all regions will be saved in master. So each server will have thousands of > metrics, and we can not cache most of them. When we collect metrics by JMX, > we will create many objects which can be avoid. It increases the pressure of > GC and JMX has some caching logic so the objects can not be removed > immediately which increases the pressure more. > Interns is in Hadoop project, and I think the implementation is not suitable > for HBase. Because we can not know how many MetricsInfo we have, it depends > on the number of regions. And we can not set it unlimited because we should > remove the objects whose region is split, moved, or dropped. I think we can > use Guava's cache with expireAfterAccess which is very simple and convenient. > So we can add a new Interns class in HBase project first, and put it to > upstream later. > Moreover, in MutableHistogram#snapshot we create same Strings each time, we > can create them only in the first time. -- This message was sent by Atlassian JIRA (v6.3.4#6332)