This is a discussion on RE: how to purify net-snmp code within the SNMP Coders forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. --===============0955786141== Content-class: urn:content-classes:message Content-Type: multipart/alternative; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is a multi-part message in MIME format.
--===============0955786141== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C772B9.AC613E96" This is a multi-part message in MIME format. ------_=_NextPart_001_01C772B9.AC613E96 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Devi, =20 Please find my inline comments. Regards,=20 Santhosh=20 ________________________________ From: Devi U [mailto:udevi@TechMahindra.com]=20 Sent: Friday, March 30, 2007 3:22 PM To: SANTHOSH S (WT01 - Broadband Networks); net-snmp-coders@lists.sourceforge.net Subject: RE: how to purify net-snmp code =20 =20 =20 Hi, =20 Very Sorry for my late reply. I was assigned to other works and back to this problem now. after freeing varbind, memory usage was not reduced. =20 we are sending traps only and traps are received properly in management system configured.(Verified thro' Advent Net Manager - Trap viewer) I have cross verified with other implementations and i cant find any problem in our implementation. =20 Using gdb , I have identified that out of 40 K=20 1. 8K is increased in method -=20 =20 agent/agent_trap.c - send_trap_to_sess(netsnmp_session * sess, netsnmp_pdu *template_pdu) =20 we are using net-snmp version 5.3.0.1 and line 881 /* snmp_free_pdu(pdu); */ is commented. In net-snmp version 5.4 it is uncommented. [Santhosh] we used 5.2.1. This might be the issue, Uncomment snmp_free_pdu() in 5.3.0.1 and verify. =20 2. 32 K ( increasing by 8 K for every call,this method is called in for loop ) is increased in method -=20 agent/helpers/table_dataset.c - netsnmp_set_row_column(netsnmp_table_row *row, unsigned int column, int type, const char *value, size_t value_len) =20 I doubt whether memory allocated and pointed to by row is freed or not. =20 =20 Code flow to netsnmp_set_row_column=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D #0 netsnmp_set_row_column (row=3D0x187a8b8, column=3D3, type=3D2, value=3D0xffbfeb74 "", value_len=3D4) at table_dataset.c:1224 #1 0xff2c226c in log_notification (pdu=3D0x181dfa8, transport=3D0x3408) at notification-log-mib/notification_log.c:687 #2 0xff2bcc0c in send_notifications (major=3D2136456, minor=3D7, serverarg=3D0x2ffd08, clientarg=3D0xff304fe8) at notification/snmpNotifyTable.c:260 #3 0xff15ace0 in snmp_call_callbacks (major=3D1, minor=3D7, caller_arg=3D0x2ffd08) at callback.c:323 #4 0xff3688b0 in netsnmp_send_traps (trap=3D-1, specific=3D-1, enterprise=3D0xff392a64, enterprise_length=3D10, vars=3D0x2209320, context=3D0x0, flags=3D0) = at agent_trap.c:783 #5 0xff3689d0 in send_enterprise_trap_vars (trap=3D-1, specific=3D-1, enterprise=3D0xff392a64, enterprise_length=3D10, vars=3D0x2209320) at agent_trap.c:797 #6 0xff29d0bc in send_eventTrap_trap () at ssg/ssg.c:1349 <------ Here we called send_v2trap #7 0xff15d940 in run_alarms () at snmp_alarm.c:251 =20 [Santhosh] Are you adding any OID to trap var bind which is defined as/under table? To isolate the issue remove table varbinds in trap PDU and see the memory usage.=20 If with out any table OID added in the trap memory size reduced, then the issue is with the dataset (you might have used mib2c.create-dataset.conf template to implement your private table).=20 =20 =20 Thanx, Devi.U =20 ________________________________ From: santhosh.sundarasamy@wipro.com [mailto:santhosh.sundarasamy@wipro.com] Sent: Wed 3/14/2007 12:08 PM To: Devi U; net-snmp-coders@lists.sourceforge.net Subject: RE: how to purify net-snmp code =20 Devi, After freeing varbind, usage should decrease; PDU is already freed in netsnmp_send_traps() itself ( invoked by send_v2trap). Sending trap or inform? Are you receiving the traps in trapd? Cross check the API usage in other implementations (grep send_v2trap `find . -name "*.c"`) We used method similar to apps/snmptrap.c and there is no memory usage raised / leaks. Pls refer snmptrap.c file for session creation & deletion. - Santhosh ________________________________________ From: Devi U [mailto:udevi@TechMahindra.com] Sent: Tuesday, March 13, 2007 7:30 PM To: SANTHOSH S (WT01 - Broadband Networks); net-snmp-coders@lists.sourceforge.net Subject: RE: how to purify net-snmp code =20 Santhosh, =20 Thanx for ur immediate response. followed the same example - /examples/notification.c =20 snmp_free_varbind is called in our code after send_v2trap(). =20 In top output, i can see the size remains same even after snmp_free_varbind() is called.should size decrease after free is called? =20 For every 100 msec, callback will be called,snmp_varlist_add_variable() is used to store the variables and send_v2trap() is called for sending a single trap. =20 I dont know how to create session / send all traps in a single session. =20 Thanx, Devi.U ________________________________________ From: santhosh.sundarasamy@wipro.com [mailto:santhosh.sundarasamy@wipro.com] Sent: Tue 3/13/2007 7:03 PM To: Devi U; net-snmp-coders@lists.sourceforge.net Subject: RE: how to purify net-snmp code Hi Devi, The increase shown in top is memory usage by the application; all increased bytes might have not been leaked. You need to free the varbinds after sending each trap/inform. snmp_free_varbind(notification_vars); refer: http://www.net-snmp.org/dev/agent/no...c-example.html =20 Print the "top" output after freeing varbind and check the usage. Are you using single session to send all trap/inform or creating session before sending each inform/trap? - Santhosh ________________________________________ From: Devi U [mailto:udevi@TechMahindra.com] Sent: Tuesday, March 13, 2007 6:44 PM To: net-snmp-coders@lists.sourceforge.net Cc: SANTHOSH S (WT01 - Broadband Networks) Subject: RE: how to purify net-snmp code Hi, =20 thanx santhosh.. I am able to purify the code.. =20 I feel that memory leak is there when send_v2trap is called, but i am not getting any MLK/PLK in traces =20 top display: =20 26760 root 1 0 19 9248K 5608K run 0:01 0.30% snmpd =20 top display after a trap is sent =3D=3D=3D> for each trap sent there is = a increase of 40K in SIZE and goes upto 50M. 26760 root 1 0 19 9288K 5648K run 0:01 0.31% snmpd =20 we are using net-snmp version 5.3.0.1. =20 whether above increase in SIZE is memory leak? =20 Thanx, Devi.U The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Tech Mahindra, formerly Mahindra-British Telecom. Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at http://www.techmahindra.com/Disclaimer.html externally and http://tim.techmahindra.com/Disclaimer.html internally within Tech Mahindra. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =09 ------_=_NextPart_001_01C772B9.AC613E96 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} ..shape {behavior:url(#default#VML);} </style> <![endif]--> <title>RE: how to purify net-snmp code</title> <o:SmartTagType = namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"City" = downloadurl=3D"http://www.5iamas-microsoft-com:office:smarttags"/> <o:SmartTagType = namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"place" downloadurl=3D"http://www.5iantlavalamp.com/"/> <o:SmartTagType = namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"PersonName" downloadurl=3D"http://www.microsoft.com"/> <!--[if !mso]> <style> st1\:*{behavior:url(#default#ieooui) } </style> <![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} @font-face {font-family:"Book Antiqua"; panose-1:2 4 6 2 5 3 5 3 3 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:blue; text-decoration:underline;} p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; font-size:12.0pt; font-family:"Times New Roman";} span.EmailStyle19 {mso-style-type:personal-reply; font-family:"Book Antiqua"; color:blue; font-weight:normal; font-style:normal; text-decoration:none none;} p.section1, li.section1, div.section1 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; font-size:12.0pt; font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style> </head> <body lang=3DEN-US link=3Dblue vlink=3Dblue> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Book = Antiqua"><span style=3D'font-size:11.0pt;font-family:"Book = Antiqua";color:blue'>Devi,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Book = Antiqua"><span style=3D'font-size:11.0pt;font-family:"Book = Antiqua";color:blue'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Book = Antiqua"><span style=3D'font-size:11.0pt;font-family:"Book = Antiqua";color:blue'>   ; &nbs= p; Please find my inline comments.<o:p></o:p></span></font></p> <div> <p class=3Dsection1><font size=3D2 color=3Dblue face=3D"Book = Antiqua"><span style=3D'font-size:11.0pt;font-family:"Book = Antiqua";color:blue'>Regards, <br> Santhosh </span></font><font size=3D2 face=3D"Book Antiqua"><span = style=3D'font-size: 11.0pt;font-family:"Book Antiqua"'><o:p></o:p></span></font></p> </div> <div> <div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font = size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1> </span></font></div> <p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span = style=3D'font-size:10.0pt; font-family:Tahoma;font-weight:bold'>From:</span></font></b><font = size=3D2 face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'> Devi = U [mailto:<st1:PersonName w:st=3D"on">udevi@TechMahindra.com</st1:PersonName>] <br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Friday, March 30, = 2007 3:22 PM<br> <b><span style=3D'font-weight:bold'>To:</span></b> SANTHOSH S (WT01 - = Broadband Networks); <st1:PersonName = w:st=3D"on">net-snmp-coders@lists.sourceforge.net</st1:PersonName><br> <b><span style=3D'font-weight:bold'>Subject:</span></b> RE: how to = purify net-snmp code</span></font><o:p></o:p></p> </div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'><o:p> </o:p></span></font></p> <div id=3DidOWAReplyText47319> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> </div> <div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Hi,</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Very Sorry for my late reply. I was assigned to other = works and back to this problem now.</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>after freeing varbind, memory usage was not = reduced.</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>we are sending traps only and traps are received = properly in management system configured.(Verified thro' Advent Net Manager = - Trap viewer)</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I have cross verified with other implementations and = i cant find any problem in our implementation.</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Using gdb , I have identified that out of 40 K = </span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>1. 8K is increased in method - = </span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> agent/agent_trap.c - send_trap_to_sess(netsnmp_session * sess, netsnmp_pdu = *template_pdu)</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> we are using net-snmp version 5.3.0.1 = and line 881 /* snmp_free_pdu(pdu); */ is commented.</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> In net-snmp version 5.4 it is = uncommented.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Book = Antiqua"><span style=3D'font-size:11.0pt;font-family:"Book = Antiqua";color:blue'>[Santhosh] we used 5.2.1. This might be the issue, Uncomment snmp_free_pdu() in = 5.3.0.1 and verify.<o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>2. 32 K ( increasing by 8 K for every call,this = method is called in for loop ) is increased in method - = </span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> agent/helpers/table_dataset.c - netsnmp_set_row_column(netsnmp_table_row *row, unsigned int column,<br> &n bsp; &= nbsp; &nb sp; &n bsp; &= nbsp; &nb sp; int type, const char *value, size_t = value_len)</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> I doubt whether memory = allocated and pointed to by row is freed or not.</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> </span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Code flow to netsnmp_set_row_column = </span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>#0 netsnmp_set_row_column (row=3D0x187a8b8, = column=3D3, type=3D2, value=3D0xffbfeb74 "", value_len=3D4)<br> at table_dataset.c:1224<br> #1 0xff2c226c in log_notification (pdu=3D0x181dfa8, = transport=3D0x3408)<br> at notification-log-mib/notification_log.c:687<br> #2 0xff2bcc0c in send_notifications (major=3D2136456, minor=3D7, = serverarg=3D0x2ffd08,<br> clientarg=3D0xff304fe8) at = notification/snmpNotifyTable.c:260<br> #3 0xff15ace0 in snmp_call_callbacks (major=3D1, minor=3D7, caller_arg=3D0x2ffd08) at callback.c:323<br> #4 0xff3688b0 in netsnmp_send_traps (trap=3D-1, specific=3D-1, enterprise=3D0xff392a64,<br> enterprise_length=3D10, vars=3D0x2209320, = context=3D0x0, flags=3D0) at agent_trap.c:783<br> #5 0xff3689d0 in send_enterprise_trap_vars (trap=3D-1, = specific=3D-1, enterprise=3D0xff392a64,<br> enterprise_length=3D10, vars=3D0x2209320) at = agent_trap.c:797<br> #6 <strong><b><font face=3DArial><span = style=3D'font-family:Arial'>0xff29d0bc in send_eventTrap_trap () at ssg/ssg.c:1349 <------ Here = we called send_v2trap</span></font></b></strong><b><span = style=3D'font-weight:bold'><br> </span></b>#7 0xff15d940 in run_alarms () at snmp_alarm.c:251 <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Book = Antiqua"><span style=3D'font-size:11.0pt;font-family:"Book = Antiqua";color:blue'>[Santhosh] Are you adding any OID to trap var bind which is defined as/under table? = To isolate the issue remove table varbinds in trap PDU and see the memory = usage. <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Book = Antiqua"><span style=3D'font-size:11.0pt;font-family:"Book Antiqua";color:blue'>If with = out any table OID added in the trap memory size reduced, then the issue is with = the dataset (you might have used mib2c.create-dataset.conf template to = implement your private table). <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'> <o:p></o:p></span></font></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Thanx,</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Devi.U</span></font><o:p></o:p></p> </div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'><o:p> </o:p></span></font></p> <div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font = size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <hr size=3D2 width=3D"100%" align=3Dcenter tabIndex=3D-1> </span></font></div> <p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><b><font size=3D2 = face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</spa= n></font></b><font size=3D2 face=3DTahoma><span = style=3D'font-size:10.0pt;font-family:Tahoma'> santhosh.sundarasamy@wipro.com = [mailto:santhosh.sundarasamy@wipro.com]<br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Wed 3/14/2007 12:08 = PM<br> <b><span style=3D'font-weight:bold'>To:</span></b> Devi U; = <st1:PersonName = w:st=3D"on">net-snmp-coders@lists.sourceforge.net</st1:PersonName><br> <b><span style=3D'font-weight:bold'>Subject:</span></b> RE: how to = purify net-snmp code</span></font><o:p></o:p></p> </div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'><o:p> </o:p></span></font></p> <p><font size=3D2 face=3D"Times New Roman"><span = style=3D'font-size:10.0pt'>Devi,<br> After freeing varbind, usage = should decrease; PDU is already freed in netsnmp_send_traps() itself ( invoked = by send_v2trap). Sending trap or inform? Are you receiving the traps in trapd? Cross check the API usage in other implementations (grep send_v2trap `find . -name "*.c"`)<br> <br> We used method similar to apps/snmptrap.c and there is no memory usage raised / leaks. Pls refer snmptrap.c file for session creation & deletion.<br> <br> -<br> Santhosh<br> <br> ________________________________________<br> From: Devi U [<a = href=3D"mailto:udevi@TechMahindra.com">mailto:udev i@TechMahindra.com</a>]= <br> Sent: Tuesday, March 13, 2007 7:30 PM<br> To: SANTHOSH S (WT01 - Broadband Networks); <st1:PersonName = w:st=3D"on">net-snmp-coders@lists.sourceforge.net</st1:PersonName><br> Subject: RE: how to purify net-snmp code<br> <br> <br> Santhosh,<br> <br> Thanx for <st1:City w:st=3D"on"><st1:place = w:st=3D"on">ur</st1:place></st1:City> immediate response.<br> followed the same example - /examples/notification.c<br> <br> snmp_free_varbind is called in our code after send_v2trap().<br> <br> In top output, i can see the size remains same even after = snmp_free_varbind() is called.should size decrease after free is called?<br> <br> For every 100 msec, callback will be called,snmp_varlist_add_variable() = is used to store the variables and send_v2trap() is called for sending = a single trap.<br> <br> I dont know how to create session / send all traps in a single = session.<br> <br> Thanx,<br> Devi.U<br> ________________________________________<br> From: santhosh.sundarasamy@wipro.com [<a href=3D"mailto:santhosh.sundarasamy@wipro.com">mai lto:santhosh.sundarasam= y@wipro.com</a>]<br> Sent: Tue 3/13/2007 7:03 PM<br> To: Devi U; <st1:PersonName = w:st=3D"on">net-snmp-coders@lists.sourceforge.net</st1:PersonName><br> Subject: RE: how to purify net-snmp code<br> <br> Hi Devi,<br> The increase shown in top is = memory usage by the application; all increased bytes might have not been = leaked.<br> <br> You need to free the varbinds = after sending each trap/inform.<br> snmp_free_varbind(notification_vars);<br> refer: <a href=3D"http://www.net-snmp.org/dev/agent/notification_8c-example.html">h= ttp://www.net-snmp.org/dev/agent/notification_8c-example.html</a> <br> <br> Print the "top" = output after freeing varbind and check the usage.<br> <br> Are you using single session = to send all trap/inform or creating session before sending each inform/trap?<br> <br> -<br> Santhosh<br> ________________________________________<br> From: Devi U [<a = href=3D"mailto:udevi@TechMahindra.com">mailto:udev i@TechMahindra.com</a>]= <br> Sent: Tuesday, March 13, 2007 6:44 PM<br> To: <st1:PersonName = w:st=3D"on">net-snmp-coders@lists.sourceforge.net</st1:PersonName><br> Cc: SANTHOSH S (WT01 - Broadband Networks)<br> Subject: RE: how to purify net-snmp code<br> <br> Hi,<br> <br> thanx santhosh..<br> I am able to purify the code..<br> <br> I feel that memory leak is there when send_v2trap is called, but i = am not getting any MLK/PLK in traces<br> <br> top display:<br> <br> 26760 root 1 = 0 19 9248K 5608K run 0:01 0.30% snmpd<br> <br> top display after a trap is sent =3D=3D=3D> for each trap sent = there is a increase of 40K in SIZE and goes upto 50M.<br> 26760 root 1 = 0 19 9288K 5648K run 0:01 0.31% snmpd<br> <br> we are using net-snmp version 5.3.0.1.<br> <br> whether above increase in SIZE is memory leak?<br> <br> Thanx,<br> Devi.U<br> <br> <br> The information contained in this electronic message and any attachments = to this message are intended for the exclusive use of the addressee(s) and = may contain proprietary, confidential or privileged information. If you are = not the intended recipient, you should not disseminate, distribute or copy this = e-mail. Please notify the sender immediately and destroy all copies of this = message and any attachments.<br> <br> WARNING: Computer viruses can be transmitted via email. The recipient = should check this email and any attachments for the presence of viruses. The = company accepts no liability for any damage caused by any virus transmitted by = this email.<br> <br> www.wipro.com<br> <br> <br> The information contained in this electronic message and any attachments = to this message are intended for the exclusive use of the addressee(s) and = may contain proprietary, confidential or privileged information. If you are = not the intended recipient, you should not disseminate, distribute or copy this = e-mail. Please notify the sender immediately and destroy all copies of this = message and any attachments.<br> <br> WARNING: Computer viruses can be transmitted via email. The recipient = should check this email and any attachments for the presence of viruses. The = company accepts no liability for any damage caused by any virus transmitted by = this email.<br> <br> www.wipro.com</span></font><o:p></o:p></p> </div> </div> </body> </html> <table><tr><td bgcolor=3D#ffffff><font = color=3D#000000>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= 3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D<br> <br> Tech Mahindra, formerly Mahindra-British Telecom.<br> <br> Disclaimer:<br> <br> This message and the information contained herein is proprietary and = confidential and subject to the Tech Mahindra policy statement, you may = review at <a = href=3D"http://www.techmahindra.com/Disclaimer.html">http://www.techmahin= dra.com/Disclaimer.html</a> externally and <a = href=3D"http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahin= dra.com/Disclaimer.html</a> internally within Tech Mahindra.<br> <br> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D<= br> </font></td></tr></table> ------_=_NextPart_001_01C772B9.AC613E96-- --===============0955786141== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?p...rge&CID=DEVDEV --===============0955786141== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders --===============0955786141==-- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|