[Libevent-users] http input buffer deallocation problem

Cezary Rzewuski C.Rzewuski at elka.pw.edu.pl
Mon May 12 06:33:50 EDT 2008


Hello,
I'm experiencing problem with memory freeing in libevent (1.4.3 stable). 
I've implemented proxy server
using libevent http functions. Everything works OK as long as the 
workload isn't heavy - then memory
allocations grows rapidly. Memory leak detection tool (I use memoryscape 
from totalview technologies)
told me that allocation of memory that isn't deallocated is done in 
evbuffer_expand function (when realloc
is called). The backtrace is:
event_dispatch
event_loop
event_base_loop
event_read_body
evbuffer_add
evbuffer_expand
When I use tool like wget to download file, everything works fine. But 
when it's proxying crawler requests
(which meany heavy workload) the heap grows.

I suspect there may be two reasons, but I don't know if this how 
libevent works:
1) there is any priority in events processed in libevent, and buffer 
deallocation remains in the tail of events queue
2) may be there is any HTTP header that causes libevent to postpone 
closing connection (which crawler uses but wget not).

Any help appreciated.
Best regards,
Cezary Rzewuski


More information about the Libevent-users mailing list