#355 - Solr FilterCache Memory Leak - Replace SolrInfoBean in NRMetric with String #613
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Currently, the
SolrMetricManager
instrumentation in thesolr-jmx-7.0.0
andsolr-jmx-7.4.0
projects maintains a map of all tracked metrics using theMetricUtil
class.The SolrMetricManager instrumentation currently doesn't support removing metrics causing a memory leak.
This pull request adds additional instrumentation to the
SolrMetricManager
class to support removing metrics and renaming registries. It also reduces the memory footprint of theNRMetric
class by replacing theSolrInfoBean
used internally with a string.SolrInfoBean
is only used to get the name of the bean which is now past directed as a string.Related Github Issue
#355
Testing
Ran verifyInstrumentation successfully.
Ran GHA build checks successfully.
Added SolrMetricManager unit tests to cover newly supported scenarios.
Reproduced and resolved the issue on a local instance of Solr and monitored using New Relic One.
Checks
[X] Are your contributions backward compatible with relevant frameworks and APIs? Yes
[X] Does your code contain any breaking changes? Please describe. No
[X] Does your code introduce any new dependencies? Please describe. No