-
Hello, First of all, thanks to all the people contributing to tokio, it's been nice to use :) I have a question about the behaviour of ContextI am using tokio in long-running daemons, where I use message passing between a single sender and a single receiver through an unbounded channel. I noticed that the memory seemed to be leaking and I am trying to understand why this may be. As the queue seems to be relatively small most of the time (maybe hundreds of MB) with occasional bursts, I wonder why I don't see the resident memory used by my process go down after the big bursts and back to a reasonable queue size. QuestionIf I understand correctly, this snippet (reproduced below) tries to recycle the freed memory in the unbounded channel when the receiver takes a message off the queue, am I correct ? tokio/tokio/src/sync/mpsc/list.rs Lines 204 to 215 in 03969cd If so, is it possible to somehow (through a setting in the constructor or an API I could use downstream) to "force reclaim" the blocks to actually get memory back, or to skip this recycling loop ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There isn't currently any way to disable block recycling. Regardless, have you verified that it's not just your memory allocator holding on to the memory rather than it actually still being owned by the channel? |
Beta Was this translation helpful? Give feedback.
There isn't currently any way to disable block recycling.
Regardless, have you verified that it's not just your memory allocator holding on to the memory rather than it actually still being owned by the channel?