-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Spike getting QR Code #55
Comments
Thank you for reporting this. From memory, I think this is a call-out to another lib. Let us have a look... |
I appreciate your quick response guys, keep up the good work. |
@BrandonPotter v2.0.2 is ready for you to approve in AzDO |
Hey guys, while I was waiting for your release I went ahead and clone the repo and built the package myself. I tested again and it seems the library upgrade didn't fix the issue: After finishing the call the memory went down to: Just to stay there, perhaps the issue is on the dependency. As a temporary solution I had to increase the Pod memory resources to 4GB since I found that a 2nd call to function with 2Gb of memory still crash the pod. Have a great day. |
Ah that sucks. Okay, we'll dig into it some more. @ahwm I'll try to do some profiling and stuff to see if we can narrow it down. |
Sounds good. Let me know what you're able to find. I was toying with the idea of setting up a basic API that would allow the QR creation to be offloaded. If it's a completely open source web service that doesn't store anything and uses POST so that data in URLs isn't logged (the primary security concern for TOTP QR generation) then it should be all good. In theory. In the meantime, I'll see if there are any other libraries out there that would be able to generate them. |
https://github.com/BrandonPotter/GoogleAuthenticator/tree/Net.Codecrete.QrCodeGenerator Uses a different library. I suspect the memory usage might actually be related to the @eramosr16 Can you provide a code snippet of your |
Similar to #47. I guess we could try to make it more clear what a "module" is. |
I don’t know. It’s worth a try and see how big a difference it makes. |
@ahwm I did a test reducing the number from 250 to 50 and the difference was huge it went from 1.7Gb to 300Mb, it seems the issue is there, I went and download the QR library Code and they have a double loop when they go and render the image, which will increase depending on the amount of pixels, offsets and another bunch of variables. They also had a ticket to fix that, I realize that library also had a very poor support this year checking the activity the last update was on April. I think you can close this ticket since is not related with you directly, I appreciate all your effort to fix this and your feedback. |
I came across this issue creating the QR Code image inside a docker container with limited resources in RAM, the container starts with 140mb of ram and once I call the endpoint to create the image it goes up to 1.7 GB of Ram just after calling the method. Is there a way we can reduce this.
Before:
After:
This was using Aspnetcore 2.2 and GoogleAuthenticator v2.0.1
Method that generated the spike: GenerateSetupCode
The text was updated successfully, but these errors were encountered: