tutorials:troubleshooting:memory
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:troubleshooting:memory [2015/11/06 11:48] – smititelu | tutorials:troubleshooting:memory [2021/06/01 18:44] (current) – [Insufficient Memory] giavac | ||
---|---|---|---|
Line 36: | Line 36: | ||
* too small PKG or SHM - insufficient size to accommodate all data needed to be stored in memory | * too small PKG or SHM - insufficient size to accommodate all data needed to be stored in memory | ||
- | * memory leak - some part of code allocates memory at runtine | + | * memory leak - some part of code allocates memory at runtime |
===== Monitoring Memory ===== | ===== Monitoring Memory ===== | ||
Line 58: | Line 58: | ||
Notice that for SHM only one group of statistics is printed, being one zone of memory, while for PKG you get a list with many groups of statistics, each specific for a Kamailio process (child). | Notice that for SHM only one group of statistics is printed, being one zone of memory, while for PKG you get a list with many groups of statistics, each specific for a Kamailio process (child). | ||
- | In order to merge the free memory fragments one should enable memory join. This is enable by default in latest kamailio: | + | In order to merge the free memory fragments one should enable memory join. Default |
< | < | ||
mem_join=1 | mem_join=1 | ||
Line 167: | Line 167: | ||
20(4082) NOTICE: fm_status: | 20(4082) NOTICE: fm_status: | ||
20(4082) NOTICE: fm_status: | 20(4082) NOTICE: fm_status: | ||
+ | </ | ||
+ | |||
+ | If you dumped the status with qm_malloc, you can extract the logs from syslog and count the unique allocations with next commands: | ||
+ | |||
+ | < | ||
+ | grep qm_status / | ||
+ | |||
+ | # or: | ||
+ | # grep qm_status / | ||
+ | grep alloc qm_status.txt | awk '{ print substr( $0, 16, length($0) ) }' | sort | uniq -c | sort -k1n | ||
</ | </ | ||
===== Using GDB ===== | ===== Using GDB ===== | ||
Line 258: | Line 268: | ||
Here is the article that presents better the situation: | Here is the article that presents better the situation: | ||
- | | + | |
An relevant excerpt from the blog article: | An relevant excerpt from the blog article: |
tutorials/troubleshooting/memory.1446810536.txt.gz · Last modified: 2015/11/06 11:48 by smititelu