chan_h323 memory allocation


#1

Hi all,

I’m testing the h323 channel of asterisk 1.2.4 with Open H.323 version v1.17.1 and PWLib v1.9.0.

The extension I use for my test is:
exten => _X.,1,Answer
exten => _X.,2,Wait(1)
exten => _X.,n,Playback(demo-thanks)

Calling with callgen323, I notice that asterisk get bigger in memory.

Compiled asterisk with MALLOC_DEBUG and after one call, I get

*CLI> show memory allocations chan_h323.c
392 bytes allocated in build_peer at line 1967 of chan_h323.c
36 bytes allocated in external_rtp_create at line 1146 of chan_h323.c
392 bytes allocated in build_peer at line 1967 of chan_h323.c
36 bytes allocated in external_rtp_create at line 1146 of chan_h323.c
392 bytes allocated in build_peer at line 1967 of chan_h323.c
392 bytes allocated in build_peer at line 1967 of chan_h323.c
392 bytes allocated in build_peer at line 1967 of chan_h323.c
128 bytes allocated in oh323_alloc at line 823 of chan_h323.c
392 bytes allocated in build_peer at line 1967 of chan_h323.c
392 bytes allocated in build_peer at line 1967 of chan_h323.c

relative to the following source code in ast_h323.cpp:

info = on_external_rtp_create(connection.GetCallReference(), (const char *)connection.GetCallToken());
if (!info) {
cout << “\tERROR: on_external_rtp_create failure” << endl;
return;
} else {

free(info);

A quite clean code.

Why do Asterisk tell me that "external_rtp_create " haven’t been freed.

Thanks for your reply!


#2

I am seeing the same issue on 1.2.7.1 where my “free memory” slowly leaks from 220MB free until it reaches about 4MB. I am also using callgen323 and tested with ooh323 and oh323 driver.

Please let us know if you make any progress on this ?