go-zmq
go-zmq copied to clipboard
Possible memory leak PUB/SUB
Hello I have an issue with pub/sub model. I have one publisher that binds to ip:5556 and 4 workers(subs) that connects to ip:5556. Publisher After few hour of test work the usage of used memory increased. Can You please recommend me how can I solve such problem? Maybe used other zmq model My publisher code zmqContext, _ := zmq.NewContext() pub, _ := zmqContext.Socket(zmq.Pub) defer pub.Close() pub.Bind(fmt.Sprintf("tcp://%s:5556", *ip))
pubChan := pub.Channels()
defer pubChan.Close()
...
...
if *isSync {
go func() {
b.pub.Out() <- [][]byte{[]byte(*ip), []byte(fmt.Sprintf("%d|%s|%s", group.Id, link, gl))}
}()
}