newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
202 stars 143 forks source link

Ning memory leak fix #1903

Closed jasonjkeller closed 5 months ago

jasonjkeller commented 5 months ago

Resolves: https://github.com/newrelic/newrelic-java-agent/issues/783 Related to: https://github.com/newrelic/newrelic-java-agent/issues/1895

Fixes a memory that could occur with the Ning async http client instrumentation.

The leak would happen when the async client was invoked outside of an active agent transaction. This would cause the segment to be null, preventing references to the responseStatus and several other objects stored in NewFields from being released.

codecov-commenter commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.66%. Comparing base (afda029) to head (2d93bed). Report is 17 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1903 +/- ## ============================================ - Coverage 70.69% 70.66% -0.03% + Complexity 9880 9858 -22 ============================================ Files 828 826 -2 Lines 39851 39804 -47 Branches 6064 6062 -2 ============================================ - Hits 28171 28126 -45 + Misses 8954 8953 -1 + Partials 2726 2725 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.