RE: how to purify net-snmp code

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. --===============1493552920== Content-class: urn:content-classes:message Content-Type: multipart/alternative; ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2007
 
Posts: n/a
Default RE: how to purify net-snmp code

This is a multi-part message in MIME format.

--===============1493552920==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C77B2B.8134B8D5"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C77B2B.8134B8D5
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Devi,

snmp_parse_args() can be customized for your purpose, but we
wrote our own parsing logic to handle trapsink, and trapsess directive.

Regards,=20
Santhosh=20

________________________________

From: Devi U [mailto:udevi@TechMahindra.com]=20
Sent: Monday, April 09, 2007 5:20 PM
To: SANTHOSH S (WT01 - Broadband Networks);
net-snmp-coders@lists.sourceforge.net
Subject: RE: how to purify net-snmp code

=20

=20

Santhosh,

=20

I have tried using session for sending traps.There was no increase in
memory usage for each trap sent. Thanx for ur kindly help.I have
hardcoded session variable for testing. As per our existing design of
sending traps using send_v2trap() api, traps were forwarded to
management systems based on trapsess entry in snmpd.conf. Is there any
way to initialise session variable based on configuration file?

=20

Other wise i have to read trapsess entry from snmpd.conf and call
snmp_parse_args() method in snmplib/snmp_parse_args.c to initialise
session variable.

=20

Thanx,

Devi.U=20

=20

=20

=20


=20

________________________________

From: Devi U
Sent: Fri 3/30/2007 8:18 PM
To: santhosh.sundarasamy@wipro.com;
net-snmp-coders@lists.sourceforge.net
Subject: RE: how to purify net-snmp code

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

=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=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

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=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_01C77B2B.8134B8D5
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"/>
<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-face
{font-family:Tahoma;}
font-face
{font-family:"Book Antiqua";}

/* 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";}
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";}
span.emailstyle19
{font-family:"Book Antiqua";
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Book Antiqua";
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 0in 1.0in 0in;}
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'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; snmp_parse_args()
can be customized for your purpose, but we wrote our own parsing logic =
to
handle trapsink, and trapsess directive.<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> Monday, April 09, =
2007 5:20
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>&nbsp;</o:p></span></font></p>

<div id=3DidOWAReplyText85982>

<div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

</div>

<div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>Santhosh,<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'>&nbsp;<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'>I have tried using session for sending traps.There was no =
increase in
memory usage for each trap sent. Thanx for <st1:City =
w:st=3D"on"><st1:place
w:st=3D"on">ur</st1:place></st1:City> kindly help.I have hardcoded =
session
variable for testing. As per our existing design of sending traps using
send_v2trap() api, traps were forwarded to management systems&nbsp;based =
on
trapsess entry in snmpd.conf. Is there any way to initialise session =
variable
based on configuration file?<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'>&nbsp;<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'>Other wise i have to read trapsess entry from&nbsp;snmpd.conf =
and call
snmp_parse_args() method in snmplib/snmp_parse_args.c to initialise =
session
variable.<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'>&nbsp;<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'>Thanx,<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'>Devi.U&nbsp;<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'>&nbsp;<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'>&nbsp;<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'>&nbsp;<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'><br>
&nbsp;<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>

</div>

<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'> Devi U<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Fri 3/30/2007 8:18 =
PM<br>
<b><span style=3D'font-weight:bold'>To:</span></b>
santhosh.sundarasamy@wipro.com; <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>

<div id=3DidOWAReplyText65303>

<div>

<p class=3DMsoNormal><font size=3D2 color=3Dblack face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:black'>Santhosh,</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'>&nbsp;<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 for <st1:City w:st=3D"on"><st1:place =
w:st=3D"on">ur</st1:place></st1:City>
information and timely help.</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 uncommented and tested, even then 40K increase =
there
for every trap sent.</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'>&nbsp;<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 have not used table in notification, but have one =
table
in the same MIB for which get,getnext and getbulk is =
allowed.</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'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'>we have not added any OID to trap =
var bind
which is defined as/under table.</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'>&nbsp;<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 have noted that memory size is not increasing =
beyond 47MB.</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'>&nbsp;<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'>Initially when started memory size is nearly 8K. I =
guess for
nearly 1024 traps(1024*40K=3D40M) &nbsp;,memory usage increases and =
after that it
is not increasing.</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'>&nbsp;<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 dont why netsnmp_set_row_column() is hit in gdb =
while
sending the traps. </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'>&nbsp;<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>

<div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

</div>

<div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</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> Fri 3/30/2007 4:24 =
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=3D2 color=3Dblue face=3D"Book =
Antiqua"><span
style=3D'font-size:11.0pt;font-family:"Book =
Antiqua";color:blue'>Devi,</span></font><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&nbsp;<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'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;
Please find my inline comments.</span></font><o:p></o:p></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><o:p></o:p></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'>&nbsp;<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'>&nbsp;<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'>&nbsp;<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'>&nbsp;<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'>&nbsp;<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 =
-&nbsp;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'>&nbsp;<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&nbsp; , 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'>&nbsp;<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'>&nbsp;&nbsp; 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'>&nbsp;<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'>&nbsp;&nbsp; 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'>&nbsp;&nbsp; In net-snmp version 5.4 it is =
uncommented.</span></font><o:p></o:p></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.</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'>&nbsp;<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 )&nbsp; 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'>&nbsp;&nbsp; agent/helpers/table_dataset.c -
netsnmp_set_row_column(netsnmp_table_row *row, unsigned int column,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;
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'>&nbsp;<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'>&nbsp;&nbsp; I doubt whether memory =
allocated&nbsp;and
pointed to by&nbsp;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'>&nbsp;&nbsp; </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'>&nbsp;<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&nbsp;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&nbsp; netsnmp_set_row_column (row=3D0x187a8b8, =
column=3D3,
type=3D2, value=3D0xffbfeb74 &quot;&quot;, value_len=3D4)<br>
&nbsp;&nbsp;&nbsp; at table_dataset.c:1224<br>
#1&nbsp; 0xff2c226c in log_notification (pdu=3D0x181dfa8, =
transport=3D0x3408)<br>
&nbsp;&nbsp;&nbsp; at notification-log-mib/notification_log.c:687<br>
#2&nbsp; 0xff2bcc0c in send_notifications (major=3D2136456, minor=3D7,
serverarg=3D0x2ffd08,<br>
&nbsp;&nbsp;&nbsp; clientarg=3D0xff304fe8) at =
notification/snmpNotifyTable.c:260<br>
#3&nbsp; 0xff15ace0 in snmp_call_callbacks (major=3D1, minor=3D7,
caller_arg=3D0x2ffd08) at callback.c:323<br>
#4&nbsp; 0xff3688b0 in netsnmp_send_traps (trap=3D-1, specific=3D-1,
enterprise=3D0xff392a64,<br>
&nbsp;&nbsp;&nbsp; enterprise_length=3D10, vars=3D0x2209320, =
context=3D0x0, flags=3D0)
at agent_trap.c:783<br>
#5&nbsp; 0xff3689d0 in send_enterprise_trap_vars (trap=3D-1, =
specific=3D-1,
enterprise=3D0xff392a64,<br>
&nbsp;&nbsp;&nbsp; enterprise_length=3D10, vars=3D0x2209320) at =
agent_trap.c:797<br>
#6&nbsp; <strong><b><font face=3DArial><span =
style=3D'font-family:Arial'>0xff29d0bc
in send_eventTrap_trap () at ssg/ssg.c:1349 &lt;------ Here =
we&nbsp;called
send_v2trap</span></font></b></strong><b><span =
style=3D'font-weight:bold'><br>
</span></b>#7&nbsp; 0xff15d940 in run_alarms () at
snmp_alarm.c:251&nbsp;&nbsp;&nbsp;&nbsp; </span></font><o:p></o:p></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? =
&nbsp;To
isolate the issue remove table varbinds in trap PDU and see the memory =
usage. </span></font><o:p></o:p></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). </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'>&nbsp;<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'>&nbsp;<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'>&nbsp;<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'>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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?&nbsp; Cross check the API usage in other implementations (grep
send_v2trap `find . -name &quot;*.c&quot;`)<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; We used method similar to
apps/snmptrap.c and there is no memory usage raised / leaks. Pls refer
snmptrap.c file for session creation &amp; 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>
&nbsp;<br>
Santhosh,<br>
&nbsp;<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>
&nbsp;<br>
snmp_free_varbind is called in our code&nbsp;after send_v2trap().<br>
&nbsp;<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>
&nbsp;<br>
For every 100 msec, callback will be called,snmp_varlist_add_variable() =
is used
to&nbsp;store the variables&nbsp;and send_v2trap() is called for sending =
a
single trap.<br>
&nbsp;<br>
I dont know how to create session&nbsp;/ send all traps in a single =
session.<br>
&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The increase shown in top is =
memory
usage by the application; all increased bytes might have not been =
leaked.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; You need to free the varbinds =
after
sending each trap/inform.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
snmp_free_varbind(notification_vars);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>
&nbsp;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Print the &quot;top&quot; =
output
after freeing varbind and check the usage.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>
&nbsp;<br>
thanx santhosh..<br>
I am able to purify the code..<br>
&nbsp;<br>
I feel that&nbsp;memory leak is there when send_v2trap is called, but i =
am not
getting any MLK/PLK&nbsp;&nbsp;in traces<br>
&nbsp;<br>
top display:<br>
&nbsp;<br>
26760 root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp; =
0&nbsp;&nbsp; 19
9248K 5608K run&nbsp;&nbsp;&nbsp;&nbsp; 0:01&nbsp; 0.30% snmpd<br>
&nbsp;<br>
top display after a trap is sent =3D=3D=3D&gt; for each&nbsp; trap sent =
there is a
increase of 40K in SIZE and goes upto 50M.<br>
26760 root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp; =
0&nbsp;&nbsp; 19
9288K 5648K run&nbsp;&nbsp;&nbsp;&nbsp; 0:01&nbsp; 0.31% snmpd<br>
&nbsp;<br>
we are using net-snmp version 5.3.0.1.<br>
&nbsp;<br>
whether above increase in SIZE is memory leak?<br>
&nbsp;<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>

</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>
<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=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_01C77B2B.8134B8D5--


--===============1493552920==
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
--===============1493552920==
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

--===============1493552920==--

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:05 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0