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. --===============1317354946== 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.
--===============1317354946== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C772DA.787ED080" This is a multi-part message in MIME format. ------_=_NextPart_001_01C772DA.787ED080 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Santhosh, =20 Thanx for ur information and timely help. I have uncommented and tested, even then 40K increase there for every trap= sent. =20 we have not used table in notification, but have one table in the same MIB= for which get,getnext and getbulk is allowed. =20 we have not added any OID to trap var bind which is defined as/under table. =20 I have noted that memory size is not increasing beyond 47MB. =20 Initially when started memory size is nearly 8K. I guess for nearly 1024= traps(1024*40K=3D40M) ,memory usage increases and after that it is not= increasing. =20 I dont why netsnmp_set_row_column() is hit in gdb while sending the traps.= =20 =20 Thanx, Devi.U =20 ________________________________ From: santhosh.sundarasamy@wipro.com= [mailto:santhosh.sundarasamy@wipro.com] Sent: Fri 3/30/2007 4:24 PM To: Devi U; net-snmp-coders@lists.sourceforge.net Subject: RE: how to purify net-snmp code 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=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 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=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 =09 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.=20 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 =09 =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 Tech Mahindra, formerly Mahindra-British Telecom. =20 Disclaimer: 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.techmahindra.co= m/Disclaimer.html</a> externally and <a href= =3D"http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.co= m/Disclaimer.html</a> 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=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 ------_=_NextPart_001_01C772DA.787ED080 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset= =3Diso-8859-1"> <html = = = > <head> <meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)"> <title>RE: how to purify net-snmp code</title> <style> <!-- =20 font-face {font-family:Tahoma;} font-face {font-family:"Book Antiqua";} =20 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 { margin-right:0in; margin-left:0in; font-size:12.0pt; font-family:"Times New Roman";} span.EmailStyle19 { font-family:"Book Antiqua"; color:blue; font-weight:normal; font-style:normal; text-decoration:none none;} p.section1, li.section1, div.section1 { margin-right:0in; margin-left:0in; font-size:12.0pt; font-family:"Times New Roman";} div.Section1 {page:Section1;} --> </style> </head> <body lang=3DEN-US link=3Dblue vlink=3Dblue> <DIV id=3DidOWAReplyText65303 dir=3Dltr> <DIV dir=3Dltr><FONT face=3DArial color=3D#000000 size= =3D2>Santhosh,</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT> </DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2>Thanx for ur information and= timely=20 help.</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2>I have uncommented and tested,= even then=20 40K increase there for every trap sent.</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT> </DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2>we have not used table in= notification, but=20 have one table in the same MIB for which get,getnext and getbulk is=20 allowed.</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT> </DIV> <DIV dir=3Dltr><FONT color=3D#000000>we have not added any OID to trap var= bind=20 which is defined as/under table.</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT> </DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2>I have noted that memory size is= not=20 increasing beyond 47MB.</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT> </DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2>Initially when started memory= size is=20 nearly 8K. I guess for nearly 1024 traps(1024*40K=3D40M) ,memory= usage=20 increases and after that it is not increasing.</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT> </DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2>I dont why= netsnmp_set_row_column() is hit=20 in gdb while sending the traps. </FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT> </DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2>Thanx,</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2>Devi.U</FONT></DIV> <DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT> </DIV></DIV> <DIV dir=3Dltr><BR> <HR tabIndex=3D-1> <FONT face=3DTahoma size=3D2><B>From:</B> santhosh.sundarasamy@wipro.com=20 [mailto:santhosh.sundarasamy@wipro.com]<BR><B>Sent:</B> Fri 3/30/2007 4:24= =20 PM<BR><B>To:</B> Devi U;=20 net-snmp-coders@lists.sourceforge.net<BR><B>Subject:</B> RE: how to purify= =20 net-snmp code<BR></FONT><BR></DIV> <DIV> <DIV class=3DSection1> <P class=3DMsoNormal><FONT face=3D"Book Antiqua" color=3Dblue size= =3D2><SPAN=20 style=3D"FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: 'Book= Antiqua'">Devi,</SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Book Antiqua" color=3Dblue size= =3D2><SPAN=20 style=3D"FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: 'Book= Antiqua'"></SPAN></FONT> </P> <P class=3DMsoNormal><FONT face=3D"Book Antiqua" color=3Dblue size= =3D2><SPAN=20 style=3D"FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: 'Book= Antiqua'"> &nbs p; &nbs= p;=20 Please find my inline comments.</SPAN></FONT></P> <DIV> <P class=3Dsection1><FONT face=3D"Book Antiqua" color=3Dblue size=3D2><SPAN= =20 style=3D"FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: 'Book= Antiqua'">Regards,=20 <BR>Santhosh </SPAN></FONT><FONT face=3D"Book Antiqua" size=3D2><SPAN=20 style=3D"FONT-SIZE: 11pt; FONT-FAMILY: 'Book= Antiqua'"></SPAN></FONT></P></DIV> <DIV> <DIV class=3DMsoNormal style=3D"TEXT-ALIGN: center" align=3Dcenter><FONT=20 face=3D"Times New Roman" size=3D3><SPAN style=3D"FONT-SIZE: 12pt"> <HR tabIndex=3D-1 align=3Dcenter width=3D"100%" SIZE=3D2> </SPAN></FONT></DIV> <P class=3DMsoNormal><B><FONT face=3DTahoma size=3D2><SPAN=20 style=3D"FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY:= Tahoma">From:</SPAN></FONT></B><FONT=20 face=3DTahoma size=3D2><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY:= Tahoma"> Devi U=20 [mailto:udevi@TechMahindra.com] <BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, March 30, 2007 3:22=20 PM<BR><B><SPAN style=3D"FONT-WEIGHT: bold">To:</SPAN></B> SANTHOSH S (WT01= -=20 Broadband Networks); net-snmp-coders@lists.sourceforge.net<BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">Subject:</SPAN></B> RE: how to purify net-snmp= =20 code</SPAN></FONT></P></DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P> <DIV id=3DidOWAReplyText47319> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV></DIV> <DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi,</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Very Sorry for my late reply.= I was=20 assigned to other works and back to this problem= now.</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">after freeing varbind, memory= usage=20 was not reduced.</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">we are sending traps only and= traps=20 are received properly in management system configured.(Verified thro'= Advent Net=20 Manager - Trap viewer)</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have cross verified with= other=20 implementations and i cant find any problem in our=20 implementation.</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Using gdb , I have= identified=20 that out of 40 K </SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">1. 8K is increased in method= -=20 </SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"> = agent/agent_trap.c -=20 send_trap_to_sess(netsnmp_session * sess, netsnmp_pdu=20 *template_pdu)</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"> we are using= net-snmp=20 version 5.3.0.1 and line 881 /* snmp_free_pdu(pdu); */ is=20 commented.</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"> In net-snmp= version 5.4=20 it is uncommented.</SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Book Antiqua" color=3Dblue size= =3D2><SPAN=20 style=3D"FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: 'Book= Antiqua'">[Santhosh] we=20 used 5.2.1. This might be the issue, Uncomment snmp_free_pdu() in 5.3.0.1= and=20 verify.</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">2. 32 K ( increasing by 8 K= for=20 every call,this method is called in for loop ) is increased in method= -=20 </SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"> =20 agent/helpers/table_dataset.c - netsnmp_set_row_column(netsnmp_table_row= *row,=20 unsigned int=20 column,<BR> &nb sp; &nbs= p; &= nbsp;=20 &n bsp; &nb= sp;   ; =20 int type, const char *value, size_t value_len)</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"> I doubt whether= memory=20 allocated and pointed to by row is freed or=20 not.</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"> =20 </SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Code flow to=20 netsnmp_set_row_column </SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; 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=3 D=3D=3D=3D= =3D</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">#0 = netsnmp_set_row_column=20 (row=3D0x187a8b8, column=3D3, type=3D2, value=3D0xffbfeb74 "",=20 value_len=3D4)<BR> at table_dataset.c:1224<BR>#1 =20 0xff2c226c in log_notification (pdu=3D0x181dfa8,=20 transport=3D0x3408)<BR> at=20 notification-log-mib/notification_log.c:687<BR>#2 0xff2bcc0c in=20 send_notifications (major=3D2136456, minor=3D7,=20 serverarg=3D0x2ffd08,<BR> clientarg=3D0xff304fe8) at=20 notification/snmpNotifyTable.c:260<BR>#3 0xff15ace0 in= snmp_call_callbacks=20 (major=3D1, minor=3D7, caller_arg=3D0x2ffd08) at callback.c:323<BR>#4 = 0xff3688b0=20 in netsnmp_send_traps (trap=3D-1, specific=3D-1,=20 enterprise=3D0xff392a64,<BR> enterprise_length=3D10,=20 vars=3D0x2209320, context=3D0x0, flags=3D0) at agent_trap.c:783<BR>#5 = 0xff3689d0=20 in send_enterprise_trap_vars (trap=3D-1, specific=3D-1,=20 enterprise=3D0xff392a64,<BR> enterprise_length=3D10,=20 vars=3D0x2209320) at agent_trap.c:797<BR>#6 <STRONG><B><FONT=20 face=3DArial><SPAN style=3D"FONT-FAMILY: Arial">0xff29d0bc in= send_eventTrap_trap ()=20 at ssg/ssg.c:1349 <------ Here we called=20 send_v2trap</SPAN></FONT></B></STRONG><B><SPAN=20 style=3D"FONT-WEIGHT: bold"><BR></SPAN></B>#7 0xff15d940 in= run_alarms () at=20 snmp_alarm.c:251 </SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Book Antiqua" color=3Dblue size= =3D2><SPAN=20 style=3D"FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: 'Book= Antiqua'">[Santhosh] Are=20 you adding any OID to trap var bind which is defined as/under table?= To=20 isolate the issue remove table varbinds in trap PDU and see the memory= usage.=20 </SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Book Antiqua" color=3Dblue size= =3D2><SPAN=20 style=3D"FONT-SIZE: 11pt; COLOR: blue; FONT-FAMILY: 'Book Antiqua'">If with= out=20 any table OID added in the trap memory size reduced, then the issue is with= the=20 dataset (you might have used mib2c.create-dataset.conf template to= implement=20 your private table). </SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY:= Arial">Thanx,</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY:= Arial">Devi.U</SPAN></FONT></P></DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P> <DIV class=3DMsoNormal style=3D"TEXT-ALIGN: center" align=3Dcenter><FONT=20 face=3D"Times New Roman" size=3D3><SPAN style=3D"FONT-SIZE: 12pt"> <HR tabIndex=3D-1 align=3Dcenter width=3D"100%" SIZE=3D2> </SPAN></FONT></DIV> <P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 12pt"><B><FONT face=3DTahoma= size=3D2><SPAN=20 style=3D"FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY:= Tahoma">From:</SPAN></FONT></B><FONT=20 face=3DTahoma size=3D2><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY:= Tahoma">=20 santhosh.sundarasamy@wipro.com=20 [mailto:santhosh.sundarasamy@wipro.com]<BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> Wed 3/14/2007 12:08= PM<BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">To:</SPAN></B> Devi U;=20 net-snmp-coders@lists.sourceforge.net<BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">Subject:</SPAN></B> RE: how to purify net-snmp= =20 code</SPAN></FONT></P></DIV> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"></SPAN></FONT> </P> <P><FONT face=3D"Times New Roman" size=3D2><SPAN=20 style=3D"FONT-SIZE:= 10pt">Devi,<BR>   ; =20 After freeing varbind, usage should decrease; PDU is already freed in=20 netsnmp_send_traps() itself ( invoked by send_v2trap). Sending trap or= inform?=20 Are you receiving the traps in trapd? Cross check the API usage in= other=20 implementations (grep send_v2trap `find . -name=20 "*.c"`)<BR><BR>   ; We used method= similar=20 to apps/snmptrap.c and there is no memory usage raised / leaks. Pls refer=20 snmptrap.c file for session creation &=20 deletion.<BR><BR>-<BR>Santhosh<BR><BR>______________________________ _______= ___<BR>From:=20 Devi U [<A=20 href= =3D"mailto:udevi@TechMahindra.com">mailto:udevi@Te chMahindra.com</A>]<BR>Se= nt:=20 Tuesday, March 13, 2007 7:30 PM<BR>To: SANTHOSH S (WT01 - Broadband= Networks);=20 net-snmp-coders@lists.sourceforge.net<BR>Subject: RE: how to purify= net-snmp=20 code<BR><BR> <BR>Santhosh,<BR> <BR>Thanx for ur immediate=20 response.<BR>followed the same example -=20 /examples/notification.c<BR> <BR>snmp_free_varbind is called in our=20 code after send_v2trap().<BR> <BR>In top output, i can see the= size=20 remains same even after snmp_free_varbind() is called.should size decrease= after=20 free is called?<BR> <BR>For every 100 msec, callback will be=20 called,snmp_varlist_add_variable() is used to store the= variables and=20 send_v2trap() is called for sending a single trap.<BR> <BR>I dont know= how=20 to create session / send all traps in a single=20 session.<BR> <BR>Thanx,<BR>Devi.U<BR>________ _________________________= _______<BR>From:=20 santhosh.sundarasamy@wipro.com [<A=20 href= =3D"mailto:santhosh.sundarasamy@wipro.com">mailto: santhosh.sundarasamy@wipr= o.com</A>]<BR>Sent:=20 Tue 3/13/2007 7:03 PM<BR>To: Devi U;=20 net-snmp-coders@lists.sourceforge.net<BR>Subject: RE: how to purify= net-snmp=20 code<BR><BR>Hi Devi,<BR>   ; The= increase=20 shown in top is memory usage by the application; all increased bytes might= have=20 not been leaked.<BR><BR>   ; You need= to=20 free the varbinds after sending each=20 trap/inform.<BR> &nb sp;=20 =20 snmp_free_varbind(notification_vars);<BR> &nb sp; &nbs= p; =20 refer: <A=20 href= =3D"http://www.net-snmp.org/dev/agent/notification_8c-example.html">http://= www.net-snmp.org/dev/agent/notification_8c-example.html</A>=20 <BR><BR> Print the "top"= output=20 after freeing varbind and check the=20 usage.<BR><BR> Are you using= single=20 session to send all trap/inform or creating session before sending each=20 inform/trap?<BR><BR>-<BR>Santhosh<BR>__________________________________ ____= __<BR>From:=20 Devi U [<A=20 href= =3D"mailto:udevi@TechMahindra.com">mailto:udevi@Te chMahindra.com</A>]<BR>Se= nt:=20 Tuesday, March 13, 2007 6:44 PM<BR>To:=20 net-snmp-coders@lists.sourceforge.net<BR>Cc: SANTHOSH S (WT01 - Broadband=20 Networks)<BR>Subject: RE: how to purify net-snmp=20 code<BR><BR>Hi,<BR> <BR>thanx santhosh..<BR>I am able to purify the=20 code..<BR> <BR>I feel that memory leak is there when send_v2trap= is=20 called, but i am not getting any MLK/PLK in= traces<BR> <BR>top=20 display:<BR> <BR>26760 root =20 1 0 19 9248K 5608K run =20 0:01 0.30% snmpd<BR> <BR>top display after a trap is sent =3D=3D= =3D> for=20 each trap sent there is a increase of 40K in SIZE and goes upto=20 50M.<BR>26760 root 1 =20 0 19 9288K 5648K run 0:01 0.31%=20 snmpd<BR> <BR>we are using net-snmp version= 5.3.0.1.<BR> <BR>whether=20 above increase in SIZE is memory=20 leak?<BR> <BR>Thanx,<BR>Devi.U<BR><BR><BR>The information contained in= this=20 electronic message and any attachments to this message are intended for the= =20 exclusive use of the addressee(s) and may contain proprietary, confidential= or=20 privileged information. If you are not the intended recipient, you should= not=20 disseminate, distribute or copy this e-mail. Please notify the sender=20 immediately and destroy all copies of this message and any=20 attachments.<BR><BR>WARNING: Computer viruses can be transmitted via email.= The=20 recipient should check this email and any attachments for the presence of=20 viruses. The company accepts no liability for any damage caused by any= virus=20 transmitted by this email.<BR><BR>www.wipro.com<BR><BR><BR>The information= =20 contained in this electronic message and any attachments to this message= are=20 intended for the exclusive use of the addressee(s) and may contain= proprietary,=20 confidential or privileged information. If you are not the intended= recipient,=20 you should not disseminate, distribute or copy this e-mail. Please notify= the=20 sender immediately and destroy all copies of this message and any=20 attachments.<BR><BR>WARNING: Computer viruses can be transmitted via email.= The=20 recipient should check this email and any attachments for the presence of=20 viruses. The company accepts no liability for any damage caused by any= virus=20 transmitted by this=20 email.<BR><BR>www.wipro.com</SPAN></FONT></P></DIV></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=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<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.techmahindra.co= m/Disclaimer.html</a> externally and <a href= =3D"http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.co= m/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> <table><tr><td bgcolor=3D#ffffff><font color=3D#000000><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> </font></td></tr></table> <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=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<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.techmahindra.co= m/Disclaimer.html</a> externally and <a href= =3D"http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.co= m/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_01C772DA.787ED080-- --===============1317354946== 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 --===============1317354946== 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 --===============1317354946==-- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|