Description
SelectorMetrics has a per-connection metrics, which means the number of MetricName objects and the strings associated with it (such as group name and description) grows with the number of connections in the client. This overhead of duplicate string objects is amplified when there are multiple instances of kafka clients within the same JVM.
This patch address some of the memory overhead by making metricGrpName a constant and introducing a new constant perConnectionMetricGrpName. Additionally, the strings for metric name and description in createMeter have been interned since there are about 8 per-client and 4 per-connection Meter instances.
Attachments
Issue Links
- links to