-
Notifications
You must be signed in to change notification settings - Fork 2k
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
privileged agent and malloc trim #2233
Comments
As long as ngx_http_lua_log_handler is called, the malloc_trim will take effect. |
1 similar comment
As long as ngx_http_lua_log_handler is called, the malloc_trim will take effect. |
You can use gdb and add breakpoint on malloc_trim to see if it happends. |
@zhuizhuhaomeng thanks, I believe that nothing except init_worker handler is called on privileged agent, so it still feels about right that some malloc trim needs to be added for privileged agent too. I’ll investigate it a bit more. |
Perhaps we can set up a timer to actively call malloc_trim(1) using ffi in the privileged agent. This can help us see if the memory issue is due to free memory not being released. |
I think privileged workers can not trigger |
Reporting back here. We added FFI calls and tested it on Linux, but didn't find |
@bungle OpenResty XRay can help you to identify the memory issue. |
@agentzh or anyone else, do you know if the privileged agent does malloc trims? I am asking this because we would like to utilise privileged agent more, but it seems to cause more memory usage (that is never or very rarely returned - not leaking, just that memory usage spikes seem to persist for a long time). And one reason could be that it does not do malloc trims?
This (https://github.com/openresty/lua-nginx-module#lua_malloc_trim) makes a lot of sense on normal request processing workers, but privileged agent doesn't process any requests (that is what lead me to ask malloc trim in specific, but it might be unrelated to it).
The text was updated successfully, but these errors were encountered: