[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: [Discuss-gnuradio] Memory leak when creating several USRP 2objects i
From: |
Christian Kisters |
Subject: |
AW: [Discuss-gnuradio] Memory leak when creating several USRP 2objects in C |
Date: |
Fri, 26 Feb 2010 14:21:20 +0100 |
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:
address@hidden
[mailto:discuss-gnuradio-bounces+christian.kisters=nts.uni-duisburg-essen.de
@gnu.org] Im Auftrag von Eric Blossom
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
> usrp2 objects' from
> 'Jakob Meineke Thu, 30 Jul 2009 09:52:20'
> http://www.mail-archive.com/address@hidden/msg20403.html
> the problem with the memory leak still exists.
>
>
> The memory usage increases while creating several USRP2s in C.
>
> usrp2::usrp2::sptr u2;
> for (int i=0;i<20;i++)
> {
> U2.reset();
> u2 = usrp2::usrp2::make("eth0","");
> }
>
> The used memory will be released only by closing the program. So it's
> expected that the memory runs out of its limits.
>
> Has someone an idea how to fix this problem?
>
> Best regards
> 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
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
figure1.png
Description: PNG image