* Problem:
----------
I am using net-snmp 5.4 version. One of our application sends trap using
send_v2trap() function. When ever this function is called I am seeing
memory increase in "snmpd" process. Just after send_v2trap function I am
calling "snmp_free_varbind" also. The connectivity between our
application and snmpd is AgentX.

* Problem isolation:
--------------------
To isolate the issue, I used "$NET-SNMP-INSTALL-
DIR/agent/mibgroup/examples/notification.c" file to experiment the same.
I see the same behaviour. When ever send_v2trap is called I am seeing
snmpd is leaking memory. Around 4-8 bytes every time.


* More experiments:
-------------------
Then I experimented same in Net-SNMP-5.3.0.1 also. Same behaviour.

Connected this application and snmpd via tcp,udp,unix based AgentX
communication mechanism. The result are same.

Then I tried using valgrind for "snmpd" in following way.

valgrind --tool=memcheck snmpd -f -Le -Dagentx -xtcp:localhost:3456


* ValGrind result without calling send_v2trap():
------------------------------------------------
Received TERM or STOP signal... shutting down...
==22760==
==22760== ERROR SUMMARY: 354 errors from 14 contexts (suppressed: 50
from 2)
==22760== malloc/free: in use at exit: 496844 bytes in 14225 blocks.
==22760== malloc/free: 105774 allocs, 91549 frees, 27785880 bytes
allocated.
==22760== For a detailed leak analysis, rerun with: --leak-check=yes
==22760== For counts of detected errors, rerun with: -v



* ValGrind result with 90 times calling send_v2trap():
------------------------------------------------------
==22762==
==22762== ERROR SUMMARY: 3093 errors from 18 contexts (suppressed: 50
from 2)
==22762== malloc/free: in use at exit: 1000010 bytes in 17818 blocks.
==22762== malloc/free: 128827 allocs, 111009 frees, 40674529 bytes
allocated.
==22762== For a detailed leak analysis, rerun with: --leak-check=yes
==22762== For counts of detected errors, rerun with: -v



>From the above result we can easily make out there is memory leak in

snmpd. Can some one help me on the same.



--


Regards,
-Navaneetham


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders