Closed kaykurokawa closed 5 years ago
Ill investigate, if you have some valgrind output will be helpful. So i can take this issue, if you have priority work to do.
I've done it in this way:
I have a implementation in my local branch that resolve issue, i'll write a little unit test to check number of destroyed nodes.
@bvbfan Could you let me know the status of this, please?
It's on hold, it waits normalization and upstream merge.
CClaimTrieNode (nodes on a claimtrie) is currently allocated/de-allocated through the new/delete operators which has caused some problems in the past: https://github.com/lbryio/lbrycrd/pull/94
Using shared pointers would be a good improvement over this, so this could be the first step on this issue. Furthermore, we need to restructure the code so that we have a fixed size memory pool that limits the number of CClaimTrieNode objects that can be loaded into memory, while the rest is kept on disk (at this point the code will create CClaimTrieNode objects until it runs out of memory)
This PR was started to solve this problem https://github.com/lbryio/lbrycrd/pull/100 using the PIMPL idiom but was left unfinished. I think it has the right idea, but it ran into a bug that we could not resolve. Further work on this should at least involve looking over this PR to see if it is a good approach, and suggest alternative approach if not.
Acceptance Criteria
1. 2. 3.
Definition of Done