Hi guys -
The project I'm working on involves uploading hundreds of images at a time. I've noticed that the memory consumption in the browser just continues to grow and grow, until eventually it takes up upwards of 2GB RAM. The total size of the uploads is 1.5GB, about 600 photos, so it seems like the files are loaded into memory on the client application, but they are never garbage collected or disposed of. When I refresh the tab, the memory usage goes back down to about 250MB, and it increases every time a file is uploaded.
I am using Async upload with a Blazor server side API endpoint. Everything else works as I expect, just the memory usage is going to cause issues when users start uploading 4GB folders or larger (due to processor constraints).
I'm not sure what more information you would find helpful. I think this issue is present even on the simplest of SfUploader configurations and it seemed to be the same when I wasn't using Async settings.
I've actually just realized that at some point the browser tab gets capped on memory and the UploadSuccess calls don't end up getting called, so it's a pretty serious issue. Is there any way I can clear the upload list manually or remove files from memory once they have been uploaded?
I think you can reproduce this by uploading any large file or set of files.
Thanks,
Tharon
public void OnClick()
{
UploadObj.ClearAllAsync();
} |
private void onRemove(RemovingEventArgs args)
{
foreach(var removeFile in args.FilesData)
{
if (File.Exists(Path.Combine(@"D:\VS\Blazor\Blazor_Server\Blazor_Server", @"path" + removeFile.Name))) ;
{
File.Delete(Path.Combine(@"D:\VS\Blazor\Blazor_Server\Blazor_Server", @"path" + removeFile.Name));
}
}
} |
I will create a sample for you shortly and upload for your review.
Thanks!
Hi -- I have attached a project sample to demonstrate the issue. Here is a quick folder with some screenshots of the issue
1 : The apps tarts up and takes up about 100MB. https://drive.google.com/file/d/1S_Orb0tWreKMFJRQOGwKtFJAk1TChbee/view?usp=sharing
2. Select a lot of images. In this example there are about 550 images, totaling 1.16GB. The memory usage goes to 160MB, still pretty reasonable https://drive.google.com/file/d/11rCueLaIQVJsKKcmfwheYHt5dbIM6UBO/view?usp=sharing
3. I started the upload. The application quickly consumes as much memory as it can, jumping to 1.9GB, and crushing the browser, it's basically unresponsive https://drive.google.com/file/d/1_EzmOq9UPHW3DbHGQnPB8a7WVAiPKRDQ/view?usp=sharing
4. The upload completes, and I cleared the Upload List using the default Clear button (I believe this calls ClearAllAsync()). The memory usage stays the same. https://drive.google.com/file/d/1H0qL07jC-nLr0Uiv-gkd5Znq3Nm5dHNv/view?usp=sharing
5, 6. Select a different folder to upload, the memory stays the same:
https://drive.google.com/file/d/1mZdCX-PQC61LOq2HR2pAdArOTd5ZN2FZ/view?usp=sharing
https://drive.google.com/file/d/1dx2FS65TqFgJZxS4_q4WLhttaElPxG_l/view?usp=sharing
7. When I click "Upload", memory drops back down to ~250MB, until the upload starts and the new files are loaded into memory: https://drive.google.com/file/d/1ZzHBqsK9jlYTtTvYKUvZcrFOaQ6Aj0sa/view?usp=sharing
A couple thoughts ---