There is a cool application for finding memleaks: valgrind
1. install valgrind ("apt-get install valgrind" or "zypper install valgrind")
2. compile oscam with debug (see Howto help the devs finding SEGFAULTS in oscam)
3. start oscam with valgrind:
[TABLE="width: 1265, align: center"]
[TR]
[TD][TABLE="class: tableinborder, width: 1259"]
[TR="class: smallfont"]
[TD="class: tablecat, bgcolor: #6A819A, colspan: 2"]code:[/TD]
[/TR]
[TR="class: smallfont"]
[TD="class: inposttable, bgcolor: #6A819A, align: right"]1:[/TD]
[TD="class: inposttable, bgcolor: #6A819A"]valgrind -v --leak-check=full --show-reachable=yes --error-limit=no --undef-value-errors=no --log-file=valgrind.log oscam -r0 -c /var/oscam[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]
4. Then oscam is running in valgrinds memory analyser. Valgrind collects various memory informations. Always stop oscam with "shutdown", never never stop it with kill!
Now you get a long output. The interessting part is the LEAK SUMMARY:
==13662== LEAK SUMMARY:
==13662== definitely lost: 0 bytes in 0 blocks.
==13662== possibly lost: 0 bytes in 0 blocks.
==13662== still reachable: 486,935 bytes in 8,473 blocks.
==13662== suppressed: 0 bytes in 0 blocks.
==13662== Reachable blocks (those to which a pointer was found) are not shown.
==13662== To see them, rerun with: --leak-check=full --show-reachable=yes