-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Memory leak in request_queue when sending messages with files #1091
Comments
as well as unique_ptr you may have to rehash the maps periodically by copying all data to a new one. This is the only way to force unordered map to release its buckets. |
This does not seem to occur on Windows and currently looks like a Linux only bug... |
I'm now working on this. |
To further make this confusing, this leak does not happen on Mac OSX either. So it really is Linux only... |
:thonk: I think i can look into that, ima test on my machine |
The fix that @Mishura4 implemented doesn't seem to work. This also seems to be an issue with only libstdc++. Upgrading to a newer g++ fixes it (as long as you use that newer g++) as it appears newer versions of libstdc++ have this fixed. |
updating to what? I'm on g++ 12.3.0 on my production machines, where the problem persists...? It's literally the latest available g++ on ubuntu 22.04.
|
Oh? Maybe upgrading isn't a fix then. |
Git commit reference
9c549f5
Describe the bug
Sending messages, with files, causes a memory leak. The leak is bigger if the file is bigger.
The issue seems to be coming from:
and the queue itself.
The data doesn't actually get removed until the final request has been deleted from the queue.
if you're making frequent requests, the map will never empty, meaning the data is never freed (not sure why).
However, even when the queue is now empty, the ram doesn't fully recover. For example:
To Reproduce
Expected behavior
The memory should slowly clear with every remove from the queue.
Ideally, we should use
unique_ptr
so we can avoid the 60 second queue sillyness.System Details:
The text was updated successfully, but these errors were encountered: