Open JannikBreuer opened 1 month ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.
I also created a minimal API to make sure that the problem is not on our side, but the problem is still there:
app.MapGet("/blobStorageTest", async () =>
{
var _azureBlobStorageImageSourceContainerProxy = new BlobContainerClient("ConnectionString", "container");
var arrayWithManyImages = new List<string>
{
"TestImage1.jpg",
};
foreach (var image in arrayWithManyImages)
{
Response<BlobDownloadResult> content = await _azureBlobStorageImageSourceContainerProxy.GetBlobClient(image).DownloadContentAsync();
}
})
.WithName("blobstorageTest")
.WithOpenApi();
Library name and version
Azure.Storage.Blobs 12.21.1
Describe the bug
Our application needs to download and upload many images from a blob storage. We used the following logic for this: (We have also tried the stream variant, but the same problem occurs)
I have left out the upload part, as the download part is already causing the problem.
Locally, I have executed this method several times and left the API running for a long time afterwards. I would have assumed that after a short time it would release/delete the byte arrays it needed to download the images. But unfortunately, it doesn't, which is why the memory consumption keeps increasing:
This is the memory usage after starting my API:
This is the memory usage after executing the method mentioned above a couple of times:
As you can see in the picture, the garbage collector clears up the heap, but the unmanaged memory remains the same size.
Am I missing something or am I doing something wrong?
Expected behavior
Memory is cleaned up by the garbage collection
Actual behavior
Memory is not released/cleared again
Reproduction Steps
Loading many images multiple times.
Environment
.Net 8 - ASP .NET API