-
Notifications
You must be signed in to change notification settings - Fork 330
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 observed. #646
Comments
Hello, Are those 2 million counters you actual use case or did you only use such a big number to make the "leak" visible? What you are seeing here is a pretty bad case of memory fragmentation. If you add a It looks like the glibc memory allocator (in its default configuration) is doing a bad job here. If I replace it with tcmalloc I don't experience any growth: A run with
There are multiple ways how to deal with the problem. The easiest would be to omit the intermediate representation and directly stream into non-contiguous I/O buffers (or directly into the HTTP response stream). This change would also get rid of the memory spikes during the requests. But this change will take some time to apply. Thanks, |
Modified the sample_server program to add 2M counters.
During addition, the memory seems constant which is ok.
During curl, there is some memory being allocated as Private and not getting cleared. This keeps increasing with each curl and then the container runs out of memory.
SAMPLE SERVER code:
MEMORY LEAK:
1. Memory, After metrics data is added (Run sample_server):
2. Memory, during curl(1st) execution:
3. Memory, after curl(1st) completed:
4. Memory, during curl(2nd) execution:
5. Memory, after curl(2nd) completed:
6. Memory, during curl(3rd) execution:
7. Memory, after curl(3rd) completed:
8. Memory, during curl(4th) execution:
9. Memory, after curl(4th) completed:
The text was updated successfully, but these errors were encountered: