Dialogic IMG - How to use MemScope to check for memory leaks

Dialogic IMG - How to use MemScope to check for memory leaks

Table of Contents

Symptom

There are times when Dialogic may request a Dialogic IMG Integrated Media Gateway or Dialogic MSP Multi Services Platform customer to run MemScope to check for a potential memory leak.  This request may result from an earlier recorded issue, or behavior currently exhibited by the IMG or MSP.

Reason for the issue

MemScope is an easy way to verify if a particular message or call flow results in memory not being deallocated.  If the MemScope print data command (see below) returns one or more entries, a memory leak exists.

Fix / Solution

MemScope can be enabled and disabled using a telnet session.

To enable MemScope:

  • type 'o' to enter "Operating System Information"

  • type 'n' to create the Memory Scope database

  • type 'o' to start the Memory Scope data collection

To print the subsequent Memory Scope data (if any):

  • type 'p' followed by a duration in seconds (for example: '3600' for 1 hour)

  --> this will dump any function call where the memory has not been returned for over a 1 hour duration. 

Notes

  1. The MemScope database must have been created ('n') and running ('o') for at least 60 seconds, otherwise the print data is of no value

  2. This example assumes the call flow does not produce calls exceeding the "Age" specified (3600); if calls do persist for more than the period specified then memory may legitimately remain deallocated.

To disable MemScope...

  • type 'O' to stop the Memory Scope data collection

  • type 'N' to destroy the Memory Scope database (to be performed after the print data has been collected)

For example:

> o os> h OS CLI Menu c - CPU Utilization Mode(Print Disabled) C - CPU Utilization f - Fault Diagnostics z - Cache Information H - CPU Utilization History i - Task Information I <taskID> - Task Detailed m - Memory Information (OS) M - zOsMem Information n - zOsMem Memory Scope create database N - zOsMem Memory Scope destroy database o - zOsMem Memory Scope start data collection O - zOsMem Memory Scope stop data collection p - zOsMem Memory Scope print data P - zOsMem Memory Scope print stats Q - Queue Information s - Stack Information t <taskID> - Task Stack Information (Tornado 'tt') w - Watchdog Information y - Task Monitor information q - Quit os> n Creating Memory Scope database os> o Memory scope data collection started

 

This is an example of an ideal scenario, where the IMG or MSP is not leaking memory:

os> p Age: 3600 MemScope database does not exist

 

This is an example of an MSP leaking memory:

p Age: 3600 22:10:24.619 MemScope list of entries at least 3600 seconds old entry:79258 address:0x1d496a80 size:0x2c cookie:0xc12029d8 age:5327 0x00eb61b0: zOsMem_Alloc + 0x228 0x00eb2750: rn_getseg + 0x1c 0x009e3ea0: servGetMem + 0x24 0x00b01a04: scap_add_timer + 0x40 0x00ba5ffc: tcapdha_af_57 + 0xc0 0x00e4bee0: ppl_stmch_interpreter + 0x11c 0x00e4c5dc: ppl_stmch + 0x254 0x00bac2e4: tcap_process_internal_msg + 0x2a8 0x00baca84: tcap_process_ext_int_msg + 0x5b8 0x00afb528: scap_process_mod_msg + 0xcc 0x00afbb0c: scap_pre_process_ext_msg + 0x2a4 entry:255698 address:0x1d4921f0 size:0x2c cookie:0xc12029d8 age:3960 0x00eb61b0: zOsMem_Alloc + 0x228 0x00eb2750: rn_getseg + 0x1c 0x009e3ea0: servGetMem + 0x24 0x00b01a04: scap_add_timer + 0x40 0x00ba5ffc: tcapdha_af_57 + 0xc0 0x00e4bee0: ppl_stmch_interpreter + 0x11c 0x00e4c5dc: ppl_stmch + 0x254 0x00bac2e4: tcap_process_internal_msg + 0x2a8 0x00baca84: tcap_process_ext_int_msg + 0x5b8 0x00afb528: scap_process_mod_msg + 0xcc 0x00afbb0c: scap_pre_process_ext_msg + 0x2a4 entry:291917 address:0x1d662a88 size:0x2c cookie:0xc12029d8 age:7083 0x00eb61b0: zOsMem_Alloc + 0x228 0x00eb2750: rn_getseg + 0x1c 0x009e3ea0: servGetMem + 0x24 0x00b01a04: scap_add_timer + 0x40 0x00ba5ffc: tcapdha_af_57 + 0xc0 0x00e4bee0: ppl_stmch_interpreter + 0x11c 0x00e4c5dc: ppl_stmch + 0x254 0x00bac2e4: tcap_process_internal_msg + 0x2a8 0x00baca84: tcap_process_ext_int_msg + 0x5b8 0x00afb528: scap_process_mod_msg + 0xcc 0x00afbb0c: scap_pre_process_ext_msg + 0x2a4 MemScope printed 3 entries os> O Memory scope data collection stopped os> N Memory scope database destroyed, disabling data collection os> q >

 

 

Product List

Dialogic IMG Integrated Media Gateway 1010