This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 176
Possible memory leak in getMany? #790
Labels
more information needed
Further information is requested
Comments
I've had a look around. I think its the cache - it appears to be filled up with pointers. There is a clean up if there is a non-notfound-error , but nothing to clear out the cache if its still populated by the time of the destructor presumably the fix is ~GetManyWorker() {
delete keys_;
for (const std::string* value: cache_) {
if (value != NULL) delete value;
}
} |
We also delete it on success: Line 1215 in ba729d2
|
missed that - hmm well no idea then. :/ |
@miguelmota I think you should keep your test script running longer (with 100-1000 iterations instead of 10), you might see that memory usage stabilizes over time. Garbage collection isn't deterministic and it won't collect everything immediately. |
I think you're right Closing issue since it's a false lead |
Repository owner
moved this from Backlog
to Done
in Level
Mar 6, 2022
vweevers
added a commit
to Level/classic-level
that referenced
this issue
Mar 24, 2022
vweevers
added a commit
that referenced
this issue
Mar 24, 2022
Found a leak after all: #804 |
vweevers
added a commit
to Level/rocksdb
that referenced
this issue
Mar 24, 2022
vweevers
added a commit
that referenced
this issue
Mar 24, 2022
vweevers
added a commit
that referenced
this issue
Mar 25, 2022
vweevers
added a commit
to Level/rocksdb
that referenced
this issue
Mar 25, 2022
vweevers
added a commit
to Level/classic-level
that referenced
this issue
Mar 25, 2022
vweevers
added a commit
to Level/rocksdb
that referenced
this issue
Mar 25, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
first of all thanks for providing this awesome package!
I've noticed that memory usage is creeps up higher when using
getMany
vs pushing to an array withget
.Examples
Using
.get
and pushing to an array:Using
.getMany
:Running the examples multiple times shows that using
getMany
allocates more memory over time.I know very little about memory leaks so let me know if I'm looking at this the wrong way! We've noticed our program eventually crashes because the memory keeps growing when using getMany (mabye) so wondering if this is expected behavior (it possibly could be something else in my application). Thanks!
The text was updated successfully, but these errors were encountered: