Sync::mpsc::channel shrink?

Hey,
I'm not sure about the implementation specifics of mpsc::channel, but I suspect that after several calls to send it grows in size and doesn't shrink after it is drained (I'm using try_recv).

I think this is the case because I saw a big inflation in memory size of my app that remained the same after the big influx of messages ended.

Am I right to suspect the channel keeps its capacity and doesn't shrink down? is there a way to do it?

Thanks!

As far as I know the channels use linked lists, so there's no such thing as unused capacity.

1 Like

@alice I see, thanks.