[Freeswitch-users] Best practices for memory pool usage in modules?

Nathan Neulinger nneul at mst.edu
Sat Aug 3 02:51:54 MSD 2013


In almost all of these cases, it's "allocate space to package up a message/pdu then send it over the socket", so it 
sounds like a simple malloc makes more sense.

-- Nathan

On 08/02/2013 05:46 PM, Anthony Minessale wrote:
> If the object has a complex life cycle then pools are better.  If its short lived frequent little one-off allocations
> may as well malloc
>
> On Aug 2, 2013 4:40 PM, "Nathan Neulinger" <nneul at mst.edu <mailto:nneul at mst.edu>> wrote:
>
>     I'm looking into memory leak issues with mod_skinny, and it seems clear that it's repeatedly allocating memory when it
>     doesn't really need to hang onto it permanently.
>
>     Since it has both a long standing connection to each device (listener) and has requests coming in regularly that
>     currently are allocating memory and appear to be leaking it since the listener stays around.
>
>     Would having the code allocate a new temporary sub-pool for each request that comes in be appropriate, or would it be
>     better to just use regular malloc for those allocate/use/destroy cases?
>
>     -- Nathan
>
>     ------------------------------------------------------------
>     Nathan Neulinger nneul at mst.edu <mailto:nneul at mst.edu>
>     Missouri S&T Information Technology (573) 612-1412 <tel:%28573%29%20612-1412>
>     System Administrator - Architect
>
>     _________________________________________________________________________
>     Professional FreeSWITCH Consulting Services:
>     consulting at freeswitch.org <mailto:consulting at freeswitch.org>
>     http://www.freeswitchsolutions.com
>
>     
>     
>
>     Official FreeSWITCH Sites
>     http://www.freeswitch.org
>     http://wiki.freeswitch.org
>     http://www.cluecon.com
>
>     FreeSWITCH-users mailing list
>     FreeSWITCH-users at lists.freeswitch.org <mailto:FreeSWITCH-users at lists.freeswitch.org>
>     http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>     UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>     http://www.freeswitch.org
>

-- 
------------------------------------------------------------
Nathan Neulinger                       nneul at mst.edu
Missouri S&T Information Technology    (573) 612-1412
System Administrator - Architect



Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list