-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[KMP] Memory leak found in AnyAddress #4021
Comments
Hi @10gic, good catch! I'll investigate what can be the reason for the memory leak. |
Hi @satoshiotomakan, I found that this is a common issue. It exists in HDWallet, PrivateKey, PublicKey, and others. For swift binding (swift/Sources/Generated/AnyAddress.swift), we have deinit code to release memory:
For wasm binding (wasm/src/generated/AnyAddress.h), we have destructor to release memory:
Kotlin don't support destructor, we need to think of other solutions to release memory. |
Hi @satoshiotomakan, do you have any ideas on how to fix this issue (#4021)? |
@10gic |
Hi @10gic, we're trying to investigate, how it can be fixed. Will let you know once I have an update |
I'm glad to hear this. Hope there is good news soon. |
Describe the bug
I found a memory leak in AnyAddress within the Kotlin package of Wallet Core.
To Reproduce
The following code can trigger a memory leak:
Expected behavior
No memory leak.
Screenshots
Memory Profiler Screenshot:
Additional context
The above test was conducted on Android. Based on the generated code in directory wallet-core-kotlin, this issue should also exist on iOS.
The text was updated successfully, but these errors were encountered: