openhab/openhab — pull request #1663 by digitaldan (2014-11-14 15:38:48+00:00)
Title: Atmos leak fix

This attempts to fix #765
Hi guys, I added a quick fix which checks for dead entries in a Map before it adds any more. I ran this for a few days and it seems to works, heap dumps show we are no longer growing this structure. I was planning on adding a executor or something along those lines to do this at a scheduled interval, but this has been working so well I'm not sure its worth the extra complication (starting, stopping and cleaning up something). A listener for when these resources expire ( like a session listener in a servlet container) would be nice, but I could not find an obvious way to do that reliably.

I do want to say this is not something usually I'm comfortable doing, I feel like the little Dutch boy sticking his fingers in the dyke trying to stop each leak! Unfortunately the atmosphere framework has beaten me ;-), at least how its being used now. But since we know its not a long term solution for openHAB, I'll keep poking away.