[Date Prev][Date Next] [Chronological] [Thread] [Top]

slap_sl_malloc



While I would hate to slow this thing down, it appears we may need to use a smarter algorithm here. Currently sl_malloc acts like a stack, objects must be freed in reverse order of allocation otherwise they remain allocated. I'm seeing a lot of "sl_malloc of XX bytes failed, using ch_malloc" log messages while watching syncrepl do its thing, which implies that there is a leak, or objects are not being freed in the correct order.

I'm not entirely sure there's a leak. But it's very likely that things aren't being freed in order, and it's difficult to verify a proper order now. Which implies that we maybe want sl_malloc/sl_free to keep a free list, coalesce blocks, etc., etc. - all the things a real malloc routine does.
--


 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support