[Asterisk-Dev] asterisk 1.20-beta1/1.0.9: using call files causes memory leak

Bruno.Voigt at ic3s.de Bruno.Voigt at ic3s.de
Thu Oct 6 12:44:52 MST 2005


Hi all,

I've detected a reproducible severe memory leak when using call files to 
generate outbound calls .
This forces me to restart asterisk at least every 6 hours.

For loadtests asterisk box A equipped with a TE410P (EuroISDN cpe) is 
connected via span 1
to another similar asterisk box B acting as EuroISDN master.

I'm performing load tests by contiously feeding up to concurrent 30 call 
files to /var/spool/asterisk/outgoing/ on box A
which inititate via a dialplan context/extension a outbound call 
(redirected via chan_local) to box b
playing some preexisting wavfiles followed by hangup.

Using Asterisk 1.20-beta1:
I see a memory growth for the asterisk process from 29M VIRT / 9M RES to 
238M VIRT / 211M RES after 25000 completed calls.

Using Asterisk 1.0.9-BRIstuffed-0.2.0-RC8o :
I see a memory growth for the asterisk process from 39M VIRT / 11M RES to 
179M VIRT / 22M RES after 1000 completed calls.

The box B acepting/recording the calls doesnt show such a memory growth 
over time.

Are there known issues about call files / memory growth in asterisk ?

The dial construct via chan_local is there to have some additional 
information about the callfile
to be tunneld thru asterisk and to provide direct feedback about the call 
success/failure to the callfile generator process.


TIA for any hints,
Bruno

callfile: TESTT05100514541601721

# An internal application id is passed concatinated with the destination 
nr in Channel:
# to have it available in the test-dial context for storing the dial 
result for later usage.
Channel: Local/TESTT05100514541601721:041234567890 at test-dial
Context: test
Extension: s
Priority: 1
CallerId: 01722270201
MaxRetries: 0
WaitTime: 35
RetryTime: 10
Account: TEST
SetVar: SMID1=TESTT05100514541601
SetVar: SMID2=721
SetVar: SMID3=
SetVar: SMINFO=TESTINFO
SetVar: SMOADC=+491722270201
SetVar: SMADC=+491234567890
SetVar: SMRETRYCNT=3

extensions.conf:
[general]
TRUNKTEST=Zap/r1

[test-dial]
;exten => _TEST.,1,SetCallerPres(prohib)
exten => _TEST.,1,SetCallerPres(allowed)
exten => _TEST.,2,Cut(SMID=EXTEN,:,1)
exten => _TEST.,3,Cut(REALEXTEN=EXTEN,:,2)
exten => _TEST.,4,Dial(${TRUNKTEST}/${REALEXTEN},30,ng)
exten => _TEST.,5,DBPut(DIALTEST/${SMID}/HANGUPCAUSE=${HANGUPCAUSE})
exten => _TEST.,6,DBPut(DIALTESTVOICE/${SMID}/DIALSTATUS=${DIALSTATUS})
exten => _TEST.,105,goto(5)
exten => _TEST.,205,goto(5)

[test]
exten => s,1,SetCDRUserField(ID=${SMID1}${SMID2}${SMID3}\;)
exten => s,2,AppendCDRUserField(ADC=${SMADC}\;)
exten => s,3,AppendCDRUserField(OADC=${SMOADC}\;)
exten => s,4,AppendCDRUserField(INFO=${SMINFO}\;)
exten => s,5,Playback(/opt/gucky/test/intro)
exten => 
s,6,Playback(/opt/gucky/test/pending/${SMID1}${SMID2}${SMID3}-filea)
exten => s,7,Playback(/opt/gucky/test/gap1)
exten => 
s,8,Playback(/opt/gucky/test/pending/${SMID1}${SMID2}${SMID3}-fileb)
exten => s,9,Playback(/opt/gucky/test/gap2)
exten => s,10,Playback(/opt/gucky/test/${SMID1}${SMID2}${SMID3}-filec)
exten => s,11,Hangup


; Hangup during play
exten => h,1,GotoIf($["${CHANNEL}" = "OutgoingSpoolFailed"]?4)
; notify callgenerator about successful accepted call
exten => h,2,TrySystem(rm -f 
/opt/gucky/test/pending/${SMID1}${SMID2}${SMID3}*)
exten => h,3,TrySystem(/bin/echo > 
${CALLGEN_PATH}/done/${SMID1}${SMID2}${SMID3}.SMT)
; do nothing
exten => h,4,NoOp(CHANNEL=${CHANNEL})

; dial attempt failed, have attempt logged as CDR with SM ID, ADC, OADC
exten => failed,1,SetCDRUserField(ID=${SMID1}${SMID2}${SMID3}\;)
exten => failed,2,AppendCDRUserField(ADC=${SMADC}\;)
exten => failed,3,AppendCDRUserField(OADC=${SMOADC}\;)
exten => failed,4,AppendCDRUserField(INFO=${SMINFO}\;)
exten => failed,5,AppendCDRUserField(RETRYCNT=${SMRETRYCNT}\;)
exten => failed,6,AppendCDRUserField(DIALSTATUS=${DIALSTATUS}\;)
; retrieve HANGUPCAUSE,DIALSTATUS stored by -dial context
exten => 
failed,7,DBGet(THANGUPCAUSE=DIALTEST/${SMID1}${SMID2}${SMID3}/HANGUPCAUSE)
exten => failed,8,AppendCDRUserField(HANGUPCAUSE=${THANGUPCAUSE}\;)
exten => failed,108,Goto(9)
exten => 
failed,9,DBGet(TDIALSTATUS=DIALTEST/${SMID1}${SMID2}${SMID3}/DIALSTATUS)
exten => failed,10,AppendCDRUserField(DIALSTATUS=${TDIALSTATUS}\;)
exten => failed,110,Goto(11)
exten => failed,11,DBDeltree(DIALTEST/${SMID1}${SMID2}${SMID3})
; notify callgenerator about failed call
exten => failed,12,SetVar(UPDASTCALL=/bin/echo \"\<DIALSTATUS\>\")
exten => failed,13,SetVar(UPDASTCALL=${UPDASTCALL}${TDIALSTATUS})
exten => 
failed,14,SetVar(UPDASTCALL=${UPDASTCALL}\"\</DIALSTATUS\>\<HANGUPCAUSE\>\")
exten => failed,15,SetVar(UPDASTCALL=${UPDASTCALL}${THANGUPCAUSE})
exten => failed,16,SetVar(UPDASTCALL=${UPDASTCALL}\"\</HANGUPCAUSE\>\")
exten => failed,17,TrySystem(${UPDASTCALL} > 
${CALLGEN_PATH}/fail/${SMID1}${SMID2}${SMID3}.SMT.tmp && /bin/mv 
${CALLGEN_PATH}/fail/${SMID1}${SMID2}${SMID3}.SMT.tmp 
${CALLGEN_PATH}/fail/${SMID1}${SMID2}${SMID3}.SMT)
;





More information about the asterisk-dev mailing list