This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
devel:how-to:troubleshoot-memory [2014/12/02 16:33] hugh.waite created |
devel:how-to:troubleshoot-memory [2015/01/30 17:41] hugh.waite Delete page due to duplicated content |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Troubleshooting kamailio 'out of memory' | ||
===== Potential causes ===== | ===== Potential causes ===== | ||
There are two cause that may lead to memory starvation: | There are two cause that may lead to memory starvation: | ||
- | a) a small pool of memory - the configured amount of memory is not enough and no more memory can be allocated. | + | - a small pool of memory - the configured amount of memory is not enough and no more memory can be allocated. |
- | b) memory leak - some memory did not properly freed, making all the memory unavailable (not used, but still allocated) | + | |
===== Determining the cause ===== | ===== Determining the cause ===== | ||
Line 9: | Line 10: | ||
Stop all traffic to the system and wait about 20 minutes. This will release memory allocated to transactions etc. | Stop all traffic to the system and wait about 20 minutes. This will release memory allocated to transactions etc. | ||
Test the system again by placing a small number of calls. If the errors start immediately, | Test the system again by placing a small number of calls. If the errors start immediately, | ||
- | + | If you are not sure of the result, consider it as a memory leak. | |
- | If the memory starvation is because of a too small pool of memory, by stopping the traffic on the proxy (without stopping the proxy), the allocated memory will be freed in time (as transactions and location records | + | |
- | TEST: wait ~ 20 minutes without any kind of load the proxy. Test the proxy by placing several calls; if the memory erros pop up again once the traffic is resumed, it means it's a memory leak somewhere; If not sure of the result, consider it' | + | |
===== How to handle it ===== | ===== How to handle it ===== | ||
Line 25: | Line 24: | ||
run kamailio -V | run kamailio -V | ||
- | '' | + | |
- | flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, | + | flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, |
- | ADAPTIVE_WAIT_LOOPS=1024, | + | ADAPTIVE_WAIT_LOOPS=1024, |
- | poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. | + | poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. |
- | id: unknown | + | id: unknown |
- | compiled on 11:59:44 Nov 3 2014 with gcc 4.4.7'' | + | compiled on 11:59:44 Nov 3 2014 with gcc 4.4.7 |
This example was compiled using the F_MALLOC memory manager and has debug support enabled. | This example was compiled using the F_MALLOC memory manager and has debug support enabled. | ||
Line 82: | Line 81: | ||
end | end | ||
- | Print used chunks of the first 2000 to 10000 if compiled with DBG_QM_MALLOC: | + | Print used chunks of the first 2000 to 10000 if compiled with DBG_F_MALLOC: |
set $i=0 | set $i=0 | ||
set $a = mem_block-> | set $a = mem_block-> |