-
Notifications
You must be signed in to change notification settings - Fork 24
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
Some memory leaks here and there due to cardano serialization lib #272
Comments
@AlexDochioiu great catch! I've opened a PR with a fix. I'll run some tests to confirm that it indeed resolved the memory leak. Hopefully I didn't miss anything :) |
That was quick 😂 . I'm pretty much looking at all our usage (directly/indirectly) of CSL because our server is leaking 1GB per day because of it and going up 😬. |
@AlexDochioiu Maybe you can try this? Emurgo/cardano-serialization-lib#542 (comment) |
We are also experiencing memory leaks in some of our projects which, I assume, is because of CSL (called from I ran What are you using to track down the memory leak? |
Took heap snapshots at fixed intervals and checked/compared them. |
Oh interesting! I didn't expect it would affect heap since in our projects we are mostly seeing leaks in external memory, but the fix does save about 20MB of heap mem (per 200k derivations). Thank you! |
Unfortunately my main expertise is not exactly rust/wasm/nodejs and I basically ran into issues trying to recompile CSL myself. Also decided it's not worth the effort to debug it any further as I'm almost fully rolling it out of our codebase in favor of Lucid (which uses CML built with that flag enabled ; can already confirm that there's no signs of any leaks coming from lucid's usage of CML). |
Thank you for the info ❤️ |
It seems that with CSL, every single object is always copied / returned as a copy and should be freed. This means that you cannot chain calls without causing a leak instantaneously.
Looking at
helpers
file, one such example is:The result of
to_raw_key()
is never stored in a variable and freed, hence it will leak memory endlessly.Those should be split into
to avoid memory leaks.
The text was updated successfully, but these errors were encountered: