Skip to content
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

Possible memory leak #27

Open
vicentroca opened this issue Feb 16, 2018 · 8 comments
Open

Possible memory leak #27

vicentroca opened this issue Feb 16, 2018 · 8 comments

Comments

@vicentroca
Copy link

I'm using this module and I see that the nginx process is eating memory without stop. ¿any idea how to debug this problem?
Thank you ;)

@arut
Copy link
Owner

arut commented Apr 6, 2018

Can you elaborate on this? What is configuration do you have? Can you simplify the configuration and find a minimum config that eats the memory.

@utu2016
Copy link

utu2016 commented May 21, 2019

Hi @arut,
I'm resuming this as I have the same issue.
I've built this module (commit ef2f874) with nginx 1.14.0:

[root@bf5203f01065 sbin]# ./nginx -V nginx version: nginx/1.14.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) configure arguments: --with-debug --add-module=/root/ts-module/nginx-ts-module/ --prefix=/root/ts-module/nginx

Then I've run it with valgrind and massif:

[root@bf5203f01065 sbin]# valgrind --tool=massif ./nginx &

According to massif there's seems to be an issue with memory allocated by the ngx_http_request_body_save_filter.

I've pushed a ts stream to nginx with the following command:

ffmpeg -re -i joined.mp4 -bsf:v h264_mp4toannexb -c copy -f mpegts http://127.0.0.1:8080/publish/fauno

I'm attaching nginx.conf and a couple of massif logs (massif.out.28 was produced without the ffmpeg -re option).

ts-module.tar.gz

Any help would be appreciated.

@utu2016
Copy link

utu2016 commented May 23, 2019

After looking into nginx code I think the problem is with chain links in rb->bufs which should be freed before setting rb->bufs = NULL as follows:

for (cl = rb->bufs; cl;) { tl = cl; cl = cl->next; ngx_free_chain(r->pool, tl); }

@micron10
Copy link

micron10 commented Dec 2, 2019

i have same issue
after 3-5 day run nginx-ts eat memory 20-30Gb
do you have fix of this problem ?

@mattpepin
Copy link

mattpepin commented Dec 12, 2019

After looking into nginx code I think the problem is with chain links in rb->bufs which should be freed before setting rb->bufs = NULL as follows:

for (cl = rb->bufs; cl;) { tl = cl; cl = cl->next; ngx_free_chain(r->pool, tl); }

Did it fix the issue for you @utu2016 ? I'm also seeing crazy RAM usage.

@masterkain
Copy link

news?

@micron10
Copy link

micron10 commented Mar 4, 2020

Any news ?

@AleXoundOS
Copy link

Is it freed after stream end? Is it specific to HLS or DASH?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants