Forum: GNU Radio pmt and dictionary blowing out memory

Posted by Jose Torres Diaz (Guest)
on 2012-11-23 00:34
(Received via mailing list)
Hi All,

I'm using some blocks that I created using pmt dictionaries. Each of 
these
blocks can run in an infinite loop, so that it is what I am testing.

I connect 2 blocks and I left them running for 10 minutes, what I found 
is
that the memory consumption (looking at using -top) is increasing every
time the work function is called. Does it mean that dictionaries are not
reused memory when the work function is called?. Because if that is the
case, it will explain why the memory consumption increases.

Thanks for your help,

Regards,

Jose.
Posted by Tom Rondeau (Guest)
on 2012-11-24 16:35
(Received via mailing list)
On Thu, Nov 22, 2012 at 6:33 PM, Jose Torres Diaz
<torresdiaz.jose@gmail.com> wrote:
>
> Thanks for your help,
>
> Regards,
>
> Jose.

PMT dictionaries are static structures and cannot be changed (as are
[mostly] all PMTs). When you add an item to a dictionary, you are
actually creating a new dictionary PMT object, not changing the
existing one.

So yes, if you're not handling things properly, you could be
continuously increasing memory usage.

Tom
Posted by Jose Torres (Guest)
on 2012-11-25 00:00
(Received via mailing list)
Hi Tom,

Thanks for your answer, is there any way to control the memory usage for 
those elements?. For example, in stream to blob example it is used _mgr 
to reuse memory, can I do something similar for dictionaries?

Regards,
Jose

Sent from my iPhone
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.