You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I found a memory leak in PublicKey within the Kotlin package of Wallet Core.
To Reproduce
The following code can trigger a memory leak:
println("Test started")
val publicKeyHex =
@Suppress("ktlint:standard:max-line-length")
"044ba28b11af1561042b03b9d0f940446315af11358aa12d798050b3cf76265dab0f48b22ea1fc1f9560c969b966221f2821b746c4e56efaeaeec8689caf5843c9"var i =1val publicKeyByteArray = publicKeyHex.hexToByteArray()
while (i <=10_000_000) {
val publicKey =PublicKey(publicKeyByteArray, PublicKeyType.SECP256k1Extended)
if (i %20_000==0) {
println("Test case $i run")
}
i++
}
println("Test completed")
Expected behavior
No memory leak.
Screenshots
Memory Profiler Screenshot:
Additional context
The text was updated successfully, but these errors were encountered:
Hi @10gic, this issue duplicates #4021
As I mentioned before, GC doesn't have time to trigger the ReferenceQueue to clean up the memory. But in real life there shouldn't be the memory leak.
However, if there is something I'm wrong with, or miss something, I'd be happy to know
Describe the bug
I found a memory leak in PublicKey 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 text was updated successfully, but these errors were encountered: