The patch I attached actually frees memory before the connection ends but do a lot of assumptions that might not work. The cleanest solution is probably just to disable chunked transfer encoding with the option: chunked_transfer_encoding off; which removes the problem at the root (if it is ok for you to disable chunked transfer encoding, of if you already implement it in the proxied server)by zanettea - Nginx Mailing List - English
Thank you, as I said I hope you will solve this annoying problem in future releases. In the meantime anyone running my same troubles can try the workaround, or the following. Indeed, I found that once the flag "chunked_transfer_encoding" is disabled, also the periodic memory allocations are disabled. However, I am not fully aware of the consequences: is it safe to use? Arrigo Zanetteby zanettea - Nginx Development
Hi, when proxying a comet server the http write filter module keeps allocating few bytes for each chunk of data coming from the comet server. These data are freed only when the request terminates, that is possibly never. There is also a forum thread (http://forum.nginx.org/read.php?2,73923) that describes the problem very well. Below I report a workaround that seems working for my application.by zanettea - Nginx Development
I have the very same problem trying to proxying a MJPEG stream. I really would appreciate a solution not involving periodically resetting the connection. Many thanks, Arrigo Zanetteby zanettea - Nginx Mailing List - English