You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Pull Request Template
## Description
Set createValueFunc to null once the Func delegate is not needed.
Without breaking the reference, the lambda function will keep capturing
of any outer variables, in #4345, DocumentServiceRequest was captured,
which prevent GC from recycling the request object, cause memory leak.
Below code, the request object will be captured by singleValueInitFunc
delegate.
```
addresses = await this.serverPartitionAddressCache.GetAsync(
key: partitionKeyRangeIdentity,
singleValueInitFunc: (_) => this.GetAddressesForRangeIdAsync(
request,
cachedAddresses: null,
partitionKeyRangeIdentity.CollectionRid,
partitionKeyRangeIdentity.PartitionKeyRangeId,
forceRefresh: false),
forceRefresh: (_) => false);
```
## Type of change
Please delete options that are not relevant.
- [] Bug fix (non-breaking change which fixes an issue)
## Closing issues
To automatically close an issue: closes#4345
---------
Co-authored-by: Guiyong Yang (from Dev Box) <[email protected]>
Co-authored-by: Kiran Kumar Kolli <[email protected]>
0 commit comments