-
Notifications
You must be signed in to change notification settings - Fork 348
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
[BUG?]memory accumulation causes oom #556
Comments
Thanks for your reporting!
Did you have a network issue, or some special configuration, so that Redis connection was broken from time to time? If the network is healthy, do you still have the OOM problem? Sorry for the late reply. Too busy these days... Regards |
u r so kind, yeah, that's right, i wrote a test case that runs above one thread using the command [zadd]. when the concurrency comes to 20k, the memory reaches 800M instantly. if there is no exception thrown, the memory will return to normal(about 14M). and if we receive exception, the memory will stay at 300M after we get all the responses, the approximate test case is as follows:
i'm sorry about not find the root cause of this problem, i will study it again during the may day holiday |
my program always has an OOM problem during a specific period of time. After a simple research, I found that the IO of write was very large during this period, which concurrency could reach 80k-100k QPS, and the memory usage increased, of course, the problem will restore after the async redis object was released.
I used the async feature of the redis++, which is a nice lib and very easy to use. Because of the above issue, I spent some time studying the source code of redis++ and hiredis. I didn't find the root cause of memory accumulation, but I found two points in
redis++, among which one point has greatly alleviated the memory stacking;
I used some memleak detection tools, such as valgrind/asan, but they all prevented the high concorrency
this is no longer a unique ptr, this point comes from
_ctx = ctx.release();
, therefore, the deletation struct is uselessHowever, when we call func
_fail_events
, hiredis may have already released the context by calling funcredisAsyncDisconnect
;The text was updated successfully, but these errors were encountered: