-
Notifications
You must be signed in to change notification settings - Fork 56
Reduce memory pressure when decrypting large binary size #119
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
base: master
Are you sure you want to change the base?
Reduce memory pressure when decrypting large binary size #119
Conversation
Do not copying `message` to calculate tag length. This could reduce memory pressure during decode the tag.
|
ping @danielberkompas 🙇 |
|
@wingyplus Sorry for the long delay here. My prior role at my job didn't leave me with much energy for open source maintenance. I really appreciate all the charts and graphs showing the performance improvement here. Can you elaborate on the exact problem though? I know it's been awhile, so you may not remember the details at this point.
|
|
@danielberkompas Let me recall the situation ...😂 In my work, I used this library to encrypt the zip file that's contain a bunch of XML file. One day our production got crash, I start investigating, and found that it crash because of OOM while decrypting the zip file, the file size is ~115MB. |
|
Hi @danielberkompas, what else I need to do to get it merge? |
|
We've encountered memory exhaustion for large files (~100 MB file consuming >4 GB memory) during decryption. I tested this PR and confirmed that memory consumption is significantly reduced. |
|
We'd love to see this make it into a release. Is there anything I can do to help out? |
Hi,
I found memory pressure issues when encrypting ~200 MB bytes and decrypting it. Let me show reproduce steps:
First, setup vault in project:
Then open IEx shell and prepare encryption:
Open observer before decrypting ciphertext and decrypting it!:
Here is screen captures from observer:
Memory Usage:
Carrier Size:
All Allocator Types:
After tweak with this PR:
Memory Usage:
Carrier Size:
All Allocator Types:
The issue that I found is copy message that is converted to list during decoding tag. The code is not perfect, feel free to discuss.