{"action":"closed","issue":{"url":"https://api.github.com/repos/tangxuehua/ecommon/issues/3","repository_url":"https://api.github.com/repos/tangxuehua/ecommon","labels_url":"https://api.github.com/repos/tangxuehua/ecommon/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/tangxuehua/ecommon/issues/3/comments","events_url":"https://api.github.com/repos/tangxuehua/ecommon/issues/3/events","html_url":"https://github.com/tangxuehua/ecommon/issues/3","id":121889238,"number":3,"title":"1.4.7版本处此是否可能造成内存溢出","user":{"login":"niaoked","id":8624021,"avatar_url":"https://avatars.githubusercontent.com/u/8624021?v=3","gravatar_id":"","url":"https://api.github.com/users/niaoked","html_url":"https://github.com/niaoked","followers_url":"https://api.github.com/users/niaoked/followers","following_url":"https://api.github.com/users/niaoked/following{/other_user}","gists_url":"https://api.github.com/users/niaoked/gists{/gist_id}","starred_url":"https://api.github.com/users/niaoked/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niaoked/subscriptions","organizations_url":"https://api.github.com/users/niaoked/orgs","repos_url":"https://api.github.com/users/niaoked/repos","events_url":"https://api.github.com/users/niaoked/events{/privacy}","received_events_url":"https://api.github.com/users/niaoked/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2015-12-13T00:30:26Z","updated_at":"2016-08-13T01:36:15Z","closed_at":"2016-08-13T01:36:15Z","body":"你好：\r\n   我在项目中正在使用1.4.7版本，PC程序作为客户端，硬件设备作为服务端。设备正常开机时内存使用正常，由于程序运行在服务器上，所以晚上设备关机后程序仍然会周期性尝试连接设备，第二一早上会发现程序内存达到2G多，正常运行时400MB左右。\r\n我查了一下代码，发现：\r\npublic void ReconnectToServer()\r\n        {\r\n            _connection.ConnectionClosed -= OnConnectionClosed;\r\n            _connection = new TcpClientConnector(_setting.TcpConfiguration).ConnectTo(Guid.NewGuid(), _localEndPoint, _serverEndPoint, OnConnectionEstablished, OnConnectionFailed);\r\n            _connection.ConnectionClosed += OnConnectionClosed;\r\n            _connection.ReceiveAsync(OnRawDataReceived);\r\n｝\r\n在每次重连时会创建一个新的TcpClientConnector对象，而在TcpClientConnector中会初始化一个Timer:\r\n _timer = new Timer(TimerCallback, null, CheckPeriodMs, Timeout.Infinite);\r\n\r\n而这个Timer在重连之前没有得到显式释放，这会不会是造成不断重连多次后内存占用越来越大？"}}
{"actor":{"display_login":"tangxuehua"}}