AW: Memory leak when creating several USRP 2objects in C

Hi Eric

Here some information for you:

C++ Code:
#include <usrp2/usrp2.h>
int main ()
{
usrp2::usrp2::sptr u2;
int count = 0;
while (count++< 3)
{
sleep(3);
u2.reset();
u2 = usrp2::usrp2::make(“eth0”,“”);
}
return 0;
}

Memory usage:
first iteration
$ pmap 11770

00007f0c6808b000 24412K rw-s- [ anon ]

total 57280K

second iteration
$ pmap 11770

00007f0c660b3000 24412K rw-s- [ anon ]

00007f0c6808b000 24412K rw-s- [ anon ]

total 81692K

third iteration
$ pmap 11770


00007f0c648dc000 24412K rw-s- [ anon ]
00007f0c660b3000 24412K rw-s- [ anon ]

00007f0c6808b000 24412K rw-s- [ anon ]
total 106104K

here you can see that every iteration uses 24412K Byte.

Sample with 23 iterations:
$ pmap 12492

00007f4cdcf22000 24412K rw-s- [ anon ]
00007f4cde6f9000 24412K rw-s- [ anon ]
00007f4cdfed0000 24412K rw-s- [ anon ]
00007f4ce16a7000 24412K rw-s- [ anon ]
00007f4ce2e7e000 24412K rw-s- [ anon ]
00007f4ce4655000 24412K rw-s- [ anon ]
00007f4ce5e2c000 24412K rw-s- [ anon ]
00007f4ce7603000 24412K rw-s- [ anon ]
00007f4ce8dda000 24412K rw-s- [ anon ]
00007f4cea5b1000 24412K rw-s- [ anon ]
00007f4cebd88000 24412K rw-s- [ anon ]
00007f4ced55f000 24412K rw-s- [ anon ]
00007f4ceed36000 24412K rw-s- [ anon ]
00007f4cf050d000 24412K rw-s- [ anon ]
00007f4cf1ce4000 24412K rw-s- [ anon ]
00007f4cf34bb000 24412K rw-s- [ anon ]
00007f4cf4c92000 24412K rw-s- [ anon ]
00007f4cf6469000 24412K rw-s- [ anon ]
00007f4cf7c40000 24412K rw-s- [ anon ]
00007f4cf9417000 24412K rw-s- [ anon ]
00007f4cfabee000 24412K rw-s- [ anon ]
00007f4cfc3c5000 24412K rw-s- [ anon ]

00007f4cfe39d000 24412K rw-s- [ anon ]

total 594344K

an plot of memory usage from 0 to 25 iterations is shown in figure1.png

Hope this information can help you

Best regards
Christian

-----Ursprüngliche Nachricht-----
Von:
discuss-gnuradio-bounces+christian.kisters=removed_email_address@domain.invalid
[mailto:discuss-gnuradio-bounces+christian.kisters=nts.uni-duisburg-essen.de
@gnu.org] Im Auftrag von Eric B.
Gesendet: Freitag, 26. Februar 2010 01:02
An: Christian Kisters
Cc: ‘discuss-gnuradio’
Betreff: Re: [Discuss-gnuradio] Memory leak when creating several USRP
2objects in C

On Wed, Feb 24, 2010 at 10:53:49AM +0100, Christian Kisters wrote:

Hi,

Like in the old thread '[Discuss-gnuradio] memory leak when creating
several
{
Chrisitan
Thanks Christian for pointing out the problem.

I’ll take a look at this, but it may be a few days.
How much is it leaking per iteration?
How are you determining how much it’s leaking?

Thanks!
Eric