[Asterisk-Dev] Memory usage?

Jon Pounder JonP at inline.net
Fri Apr 25 08:30:00 MST 2003


make a macro for however you are allocating memory (malloc etc), and keep a 
global counter of memory allocated, and decrement/increment it on free() 
and realloc() etc.

start it off at 0, and query it when you want to find out later how much a 
module is using.

either just do this in the module you care about, or do something fancy 
like using a __FILE__ macro to determine which counter to incr/decr 
depending which module is doing the work.

At 05:17 PM 4/25/2003 +0200, you wrote:
>Hello,
>
>I'd like to know if there is any CLI command like "show modules" but for
>the memory usage. I'd like to trace the memory usage of a module and see
>if it frees the memory like it should. But for this I haven't got any
>utils. Have you got an idea of how I can do it?
>
>Thank you
>Miro
>_______________________________________________
>Asterisk-Dev mailing list
>Asterisk-Dev at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-dev





More information about the asterisk-dev mailing list