-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Type of issue
[X] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement
Expected Behavior
To generate QR codes through endpoints, is there any recommended approach or is there a standard way?
var qrGenerator = new QRCodeGenerator();
var input = "00263fd622";
var qrCodeData = qrGenerator.CreateQrCode(input, QRCodeGenerator.ECCLevel.Q);
var qrCode = new Base64QRCode(qrCodeData);
var qrCodeImage = qrCode.GetGraphic(20);
Current Behavior
When there are multiple calls to the endpoint that contains the QR code generation code, the application's memory keeps increasing. While debugging, I was able to verify that this happens when the CreateQrCode method is invoked.
The application starts using 82.7 MB.
After 20 requests, the memory increases to 398.9MB.
After 100 requests, the memory increases to 1GB.
I have already tried calling the dispose methods of the qrGenerator, qrCodeData, and qrCode objects. I have also used the using statements for these objects and directly called GC.Collect(), but none of them were able to deallocate from memory.
Possible Solution (optional)
Steps to Reproduce (for bugs)
QrCoderWebTests.tar.gz
I created (POC) with the mentioned scenario, execute dotnet run, call endpoint http://localhost:5098/
and used a memory monitoring tool to track memory usage.
Your Environment
Version used: 1.4.1
Environment : .net Core 6