-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Possible memory leak in getMany? #790
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 |
Found a leak after all: #804 |
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: