Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - memory leak snmp: (5 Items)
   
memory leak snmp  
Hello QNX admins,

I am using snmp to read some information from an external device. Therefore I link snmp3r.lib and socket3r.lib so I am 
able to use function snmp_open (), ....
There is no problem with the function itself. The problem is, the DATA memory is increasing all the time!!
Is there any update or other solution about this problem??

(using tcp/ip version 5.1)

BR Ulrich

Attachment: HTML sf-attachment-mime35685 3.48 KB
Re: memory leak snmp  
Hello Ulrich,

The snmp_open() call uses malloc() to allocate memory for internal data. Don't you forget to call snmp_close()? If not 
then can you post here tarball with minimal working example that illustrates the problem?

Respectfully,
Oleg

14 нояб. 2017 г., в 13:48:12, Mailaender, Ulrich <community-noreply@qnx.com> написал:

> Hello QNX admins,
>  
> I am using snmp to read some information from an external device. Therefore I link snmp3r.lib and socket3r.lib so I am
 able to use function snmp_open (), ….
> There is no problem with the function itself. The problem is, the DATA memory is increasing all the time!!
> Is there any update or other solution about this problem??
>  
> (using tcp/ip version 5.1)
>  
> BR Ulrich

RE: memory leak snmp  
Hi Oleg,

I try to do a simple program but this takes time. So in the meantime a short description of the program

init_mib()

for ( ... )
{
	snmp_synch_setup ();
	if ( snmp_open (...))
	{
		snmp_pdu_create (...);
		read_objid (...);
		snmp_add_null_var (...);
		snmp_synch_response (...);
		snmp_free_pdu (...);
		snmp_close (...);
	}
}


Regards
Ulrich

-----Original Message-----
From: Олег Большаков [mailto:community-noreply@qnx.com] 
Sent: Wednesday, November 15, 2017 11:49 AM
To: general-qnx4@community.qnx.com
Subject: Re: memory leak snmp

Hello Ulrich,

The snmp_open() call uses malloc() to allocate memory for internal data. Don't you forget to call snmp_close()? If not 
then can you post here tarball with minimal working example that illustrates the problem?

Respectfully,
Oleg

14 нояб. 2017 г., в 13:48:12, Mailaender, Ulrich <community-noreply@qnx.com> написал:

> Hello QNX admins,
>  
> I am using snmp to read some information from an external device. Therefore I link snmp3r.lib and socket3r.lib so I am
 able to use function snmp_open (), ….
> There is no problem with the function itself. The problem is, the DATA memory is increasing all the time!!
> Is there any update or other solution about this problem??
>  
> (using tcp/ip version 5.1)
>  
> BR Ulrich





_______________________________________________

General
http://community.qnx.com/sf/go/post118204
To cancel your subscription to this discussion, please e-mail general-qnx4-unsubscribe@community.qnx.com
Re: RE: memory leak snmp  
Hi Oleg,

I have done some tests. If I slow down the for loop, no memory leak appears.
So I simply add a delay of 100ms, and everything is ok now.

Regards
Ulrich
Re: memory leak snmp  
Hi Ulrich,

It seems a bit strange, but if it's okay for you then I won't check it.

Respectfully,
Oleg

27 нояб. 2017 г., в 13:47:22, Ulrich Mailänder <community-noreply@qnx.com> написал:

> Hi Oleg,
> 
> I have done some tests. If I slow down the for loop, no memory leak appears.
> So I simply add a delay of 100ms, and everything is ok now.
> 
> Regards
> Ulrich
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post118241
> To cancel your subscription to this discussion, please e-mail general-qnx4-unsubscribe@community.qnx.com