I ran into memory issues similar to those in #286, notably the `gst_poll_read_control: assertion 'set != NULL' failed` errors. My first clue was watching `lsof`: neolink continually opened new fd's until it hit a limit (~1024 on my system), at which point it started throwing the assertion errors, so it seemed like there was something opening way too many fd's. I then did some poking around with `gdb` and `G_DEBUG=fatal-criticals` as recommended in [this mailing list](https://lists.freedesktop.org/archives/gstreamer-bugs/2017-August/203936.html), which gave me a backtrace for those failed assertions and led me to this code. I believe this was causing excess memory usage because we were allocating (and keeping permanently in memory, as best I can tell) a pool of pools: for _each unique size of message_, we allocated a new pool of buffers _for that size_, and then held onto it forever. Which means the memory usage of this pool of pools is a function of the number of **unique message sizes seen** - and at least in my case, judging by some debug logging, the message sizes were essentially random, or at least fairly evenly distributed. Thus, the number of pools we were allocating was functionally unbounded, and we were therefore trying to allocate a _lot_ of permanent pools. I definitely don't understand the details of what's going on in the rest of the code around this, but this seems like a pretty self-contained change. It seems to me that size-specific buffer pools are intended to be an optimization for the case where you have a small, defined set of common sizes of messages. This does not seem to be the case here: the message sizes, at least in my case, were essentially random. I thus removed the global pool of pools altogether, and instead simply allocate a new (scoped/limited-lifetime) buffer for every message, which presumably only lives as long as the message.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by cincodenada and has received 6 comments.