I have encountered a memory leak that seems to be related to the
a usrp2_sink object. An admittedly stupid test case that shows the same
symptoms as my actual program is given below:
from gnuradio import gr
from gnuradio import usrp2
if name == “main”:
for i in range(5):
I can then see that every two seconds the program takes up another ca.
of RAM as seen with htop. This is with rev 11516 on ubuntu 8.10.
In the test case the problem goes away if one assigns the return value
usrp2.sink_16sc as one would do of course to do anything sensible with a
In my actual program I run a twisted reactor as a main loop and
create a usrp2 sink in a function I have attached as a callback to a
deferred. The sink is part of a flow graph that transmits the content of
file created prior to execution. I then observe the same increase in the
used memory as in the above test case, which eventually leads to the
being killed. I have tried to delete the usrp2 object after use but
success. The memory leak does not occur if I comment out the creation of
I would very much appreciate your input on how to solve this problem. If
there was for example a good way to reuse the same usrp2_sink object I
happily use it. How does gnuradio handle the case that several objects
talking to the same usrp2 are created? It seemed to me that it is aware
how many instance are created.
Thank you very much in advance. Cheers,