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
The JsonDocument returned from JsonDocument.Parse is backed by one or more ArrayPool arrays; those arrays are returned when the instance is disposed. If it's never disposed, the arrays are never returned to the pool. That means that creating but not disposing lots of JsonDocument instances ends up incurring the cost (and contention) of searching the ArrayPool but ends up falling back to allocating anyway.
jsquire
added
Client
This issue points to a problem in the data-plane of the library.
Azure.Core
and removed
needs-triage
Workflow: This is a new issue that needs to be triaged to the appropriate team.
labels
Aug 16, 2023
annelo-msft
added a commit
to annelo-msft/azure-sdk-for-net
that referenced
this issue
Aug 16, 2023
See the following code:
azure-sdk-for-net/sdk/core/Azure.Core/src/DynamicData/MutableJsonChange.cs
Line 60 in c4fb4c5
The JsonDocument returned from
JsonDocument.Parse
is backed by one or more ArrayPool arrays; those arrays are returned when the instance is disposed. If it's never disposed, the arrays are never returned to the pool. That means that creating but not disposing lots of JsonDocument instances ends up incurring the cost (and contention) of searching the ArrayPool but ends up falling back to allocating anyway.This is a similar issue to AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#2178.
We need to be disposing these JsonDocument objects. See these docs.
cc @annelo-msft
The text was updated successfully, but these errors were encountered: