On Wed, Jul 16, 2014 at 3:04 AM, Kazu Yamamoto <kazu@iij.ad.jp> wrote:
I looked at your code very quickly.
What happens if you replace "replicateM" and "mapM_" to recursions?
(Especially I don't trust replicateM in IO.)

Also, we need to confirm that atomicModifyIORef' does not really leak
space.

Those functions are only executed once on start (to fork the threads, wait for them to finish, and to update the connected clients counter respectively), they cannot account for steady-state memory increase from the client loop --- the loop just does write + read + threadDelay.

G
--
Gregory Collins <greg@gregorycollins.net>