On Mon, 24 Jan 2005 22:12:07 -0800 (PST) sharath wrote:
SR> if i bring up my agent and kill it immediately, the
SR> valgrind report says 44 bytes lost. 
SR> 
SR> ==13825== LEAK SUMMARY:
SR> ==13825==    definitely lost: 44 bytes in 5 blocks.
SR> 
SR> if i send requests to my agent the the loss goes up:
SR> 
SR> ==13095== 208 bytes in 4 blocks are definitely lost in
SR> loss record 263 of 313
SR> ==13095==    at 0x1B9046A5: calloc
SR> (vg_replace_malloc.c:176)
SR> ==13095==    by 0x1BAC7EDF: init_agent_snmp_session
SR> (in /usr/lib/libnetsnmpagent.so.5.0.6)
SR> 
SR> i am calling init_agent("snmpagent") and
SR> snmp_shutdown("snmpagent") at the begining and end of
SR> my code as shown in the example-demon.c on the
SR> net-snmp tutorial.
SR> 
SR> is there anything else i must be doing to ensure there
SR> are no memory leaks ??

First off, try using a newer version.

Second, and most unfortunately, the library and agent don't really properly
clean up after themselves. An long running application which tries to start,
stop and restart the library or agent will definitely leak memory, and probably
have other problems as well.

The best you can hope for is that the agent doesn't have a growing leak while
running. The amount of memory allocated at startup and during request
processing should be stable. If there is a leak that increased with each
request or over time, then that's something we can look into.

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>  
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to