Closed David-Noble-at-work closed 4 years ago
@kushagraThapar @moderakh Is there going to be a release for this fix?
We are having very frequent memory issues with the current latest release, 2.6.6, which presumably does not have this fix yet.
@kushagraThapar @moderakh Is there going to be a release for this fix?
We are having very frequent memory issues with the current latest release, 2.6.6, which presumably does not have this fix yet.
Sure, we can release this fix as v2.6.7, would that work for you guys ?
Yes, that would be perfect. Thank you!
@henrikp-visma Release has been done - v2.6.7
We see high latency with 2.6.6 sdk. Upgrading to this version will help to reduce the latency?
Thanks, Karthick
@Karthickramk It should.
Repro
Observe
A number of leaks detections that originate here:
Fix
Simplify reference counting implementation by changing the granularity of the instances of
RntbdResponse
,RntbdToken
, andRntbdTokenStream
. Specifically,message
into three pieces as we do today:frame
,headers
, andcontent
.message
,headers
, andcontent
buffers in the first call toRntbdResponse.retain
.message
,headers
, andcontent
buffers in a call to toRntbdResponse.release
when the reference count for theRntbdResponse
hits zero.RntbdToken
value buffers because this complicates reference counting without need. AnRntbdToken
instance does not have a lifetime outside theRntbdTokenStream
that owns it.Test results
You will see in the before/after test results that this fix eliminates a memory leak in the Direct TCP stack. Performance numbers are provided for comparison with v4 master. There's no indication that performance regressed. There's some evidence in the comparison between v4 fix and v4 master that performance has improved some.
Before/After test results
Client
Cosmos
Script
mvn clean install mkdir -p azure-cosmos.results
for profile in direct e2e emulator examples fast long non-emulator; do timeout 55m mvn -P$profile -DargLine="-Dio.netty.leakDetectionLevel=paranoid -Dio.netty.leakDetection.targetRecords=255" verify | tee azure-cosmos.results/Verify-P$profile.output done