igrigorik/agent — Issue #11: Memory leak w/ channel names
Author: nate
Created: 2012-03-07 01:20:15+00:00
State: open

Channel names are required to be symbols and in Selector the channels for [timeouts](https://github.com/igrigorik/agent/blob/master/lib/agent/selector.rb#L17) and [notifications](https://github.com/igrigorik/agent/blob/master/lib/agent/selector.rb#L47) are UUIDs. This means that each time select is used it will add two symbols to ruby's symbol table.

Also, since channel names are required, users may resort to doing something similar when they don't care about the name but want to make sure that the Queue behind the scenes isn't shared between unrelated channels. I could see myself doing it.

Maybe a better way to handle storage of the memory queues would be to use a hash instead of class variables? You could then also auto-generate the name (as a string) if one is not provided, which would be nice as well.