Giter Site home page Giter Site logo

Comments (8)

chobits avatar chobits commented on June 26, 2024 1

@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.

from lua-nginx-module.

oowl avatar oowl commented on June 26, 2024 1

I think privileged workers can not trigger lua_malloc_trim function, even if we have the openresty timer task (fake request), it still can not be trigger. So as @chobits said, we can call malloc_trim in luajit ffi function to do this.

from lua-nginx-module.

zhuizhuhaomeng avatar zhuizhuhaomeng commented on June 26, 2024 1

@bungle OpenResty XRay can help you to identify the memory issue.
You can apply for a free trial https://xray.openresty.com.

from lua-nginx-module.

zhuizhuhaomeng avatar zhuizhuhaomeng commented on June 26, 2024

As long as ngx_http_lua_log_handler is called, the malloc_trim will take effect.

from lua-nginx-module.

zhuizhuhaomeng avatar zhuizhuhaomeng commented on June 26, 2024

As long as ngx_http_lua_log_handler is called, the malloc_trim will take effect.

from lua-nginx-module.

zhuizhuhaomeng avatar zhuizhuhaomeng commented on June 26, 2024

You can use gdb and add breakpoint on malloc_trim to see if it happends.

from lua-nginx-module.

bungle avatar bungle commented on June 26, 2024

@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.

from lua-nginx-module.

bungle avatar bungle commented on June 26, 2024

Reporting back here. We added FFI calls and tested it on Linux, but didn't find malloc_trim helping the situation. We need to do further investigation on memory usage before we can conclude anything. Thus I am closing this. Thank you!

from lua-nginx-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.