Comments (10)
@mohsininayatkhan Seems like you are running the commands in a wrong context where no code is running? Maybe starting your Lua app and break in the middle (like hitting Ctrl-C in the gdb session while executing the "start" or "continue" gdb commands or setting a breakpoint yourself).
from openresty-gdb-utils.
Thanks @agentzh for your reply.
Basically I have OpenResty installed on the machine and observed that there are some memory leaks while downloading a large size file through http request using
https://github.com/caquino/ranger
Can you please help me how can I debug it to find the problem area.
Thanks
from openresty-gdb-utils.
@mohsininayatkhan Maybe it's not really a memory leak but just that the default GC pace is not enough for your usage, hence the temporary memory usage spikes. Maybe you could consider using streaming processing for large responses (instead of fully buffering everything in memory at once) and/or adjust the LuaJIT GC parameters (like "setpause"). Or maybe your Lua code has memory leaks (like an ever growing globally shared Lua table or Lua string).
BTW, the lgcstat and lgcpath commands provided by this project are particularly useful in debugging GC-managed memory issues.
from openresty-gdb-utils.
is it save to call collectgarbage("collect") at the end of lua code?
Please suggest
from openresty-gdb-utils.
Tuning "setpause" is safer since "collect" is very expensive since it enforces full GC cycles.
from openresty-gdb-utils.
But still, avoiding allocating too many short-lived Lua GC objects (closures, tables, strings, and etc) in your own Lua code logic can be much much more effective and efficient. Tuning the GC parameters should only be the last resort.
from openresty-gdb-utils.
customized the following code
https://github.com/caquino/ranger/blob/master/content.lua
to generate chunks
from openresty-gdb-utils.
@mohsininayatkhan Sorry, still too large for me to follow quickly.
from openresty-gdb-utils.
Hello @agentzh, is there any step-by-step help available regarding how to debug code using this tool?
from openresty-gdb-utils.
@mohsininayatkhan Please let me know how I can improve the existing documentation of this project. I tried to give you those detailed gdb steps above but it seems that you still failed to follow. Alas.
from openresty-gdb-utils.
Related Issues (9)
- lgcstat doesn't work with latest LuaJIT HOT 8
- unsure how to install HOT 2
- no support for gc64? HOT 1
- Trying to format a gdb.Value instead of an integer HOT 2
- ldumpstack does not work on a specific Lua state without a global Lua state
- not support openresty 1.15.8.1? HOT 3
- I got "No global L located (tried globalL and ngx_cycle)" When I run lgcstat,any ngx-gdb-cmds HOT 10
- troubles to get gdb utils working for libluajit HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openresty-gdb-utils.