I guess I've always been lucky ;). The actual use case was a bit more complicated than I described as the loop wasn't quite infinite, so to speak.
Sent from my iPhone
> On May 30, 2014, at 12:48 AM, "Yichun Zhang (agentzh)" <age...@gmail.com> wrote:
>
> Hello!
>
>> On Tue, May 27, 2014 at 3:05 PM, Brian Akins wrote:
>> It depends on how you code your app. In my case, the job kicked off by the
>> timer never exited - it was an infinite loop, basically.
>
> Well, it is better to use a recurring timer than a true infinite loop
> doing nonblocking I/O because currently we allocate some small memory
> blocks (including the cosocket API) in the "request memory pool" (in
> case of timers, they are "request pools" for fake requests), so you
> may see some kind of memory leaks using the latter approach. Nginx
> assumes that requests are usually short-lived so the request memory
> pool design makes sense for true requests. I'd eventually prevent
> allocating in the request memory pool in ngx_lua's Lua API wherever
> possible but I'm not there yet.
>
> Regards,
> -agentzh.