-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Labels
Description
If I understand correctly, the goroutine ch.infiniteBuffer()
persists in memory until all the values from inner buffer are drained.
So, in situation where there are many writes, but only few reads, and then both writer/reader are done with a channel (channel goes out of their scopes), the channel won't be garbage collected as the goroutine ch.infiniteBuffer()
still runs (and we have no runtime support for our lib as for native Go channels). Which in certain circumstances (and naive usage) may lead to memory leaks.
@eapache please, correct me if I'm wrong. If not, maybe this fact needs additional mention in docs?
There is already related one, but it points to another caveat.