Rising memory in circuits IPC

16 views
Skip to first unread message

Viliam Segeda

unread,
Mar 31, 2017, 1:50:07 AM3/31/17
to circuits
Hi all,

recently I have made a long running multiprocess application based on circuits that uses lot of ipc events and later found out that the memory usage of the application constantly increases. 
When analyzing memory consumption I have seen a lot of Value objects hanging around in memory. I have prepared an example where parent and child process exchange 1MB messages that demonstrates rising memory consumption in both parent and child processes, apparently both the event arguments and result values stay in memory forever. Then I have actually spotted one place where the event values get stored indefinitely, that is Bridge()._values dict and was able to make a fix where values are removed from the dict after they are read and not needed any more, see the commit. Is such approach correct?
While the fix helped to reduce the memory in child process, it still continues to rise in parent process, seems there is still another memory leak somewhere else.
Do you have an idea where to look further?

Thanks,
Viliam

James Mills

unread,
Mar 31, 2017, 9:58:01 PM3/31/17
to circuit...@googlegroups.com
Hi Viliam,

This is awesome! Thank you for investigating and helping fix this! Do you mind posting an Issue and Pull Request for your already-working fix so far? As for where to look in the parent process I'd either look at how the Bridge() is managed in the parent (assume you're using Bridges here) or the implementation of the Value() objects being tracked.

cheers
James

--
You received this message because you are subscribed to the Google Groups "circuits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to circuits-users+unsubscribe@googlegroups.com.
To post to this group, send email to circuits-users@googlegroups.com.
Visit this group at https://groups.google.com/group/circuits-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages