{"action":"created","issue":{"url":"https://api.github.com/repos/tcalmant/jsonrpclib/issues/35","repository_url":"https://api.github.com/repos/tcalmant/jsonrpclib","labels_url":"https://api.github.com/repos/tcalmant/jsonrpclib/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/tcalmant/jsonrpclib/issues/35/comments","events_url":"https://api.github.com/repos/tcalmant/jsonrpclib/issues/35/events","html_url":"https://github.com/tcalmant/jsonrpclib/issues/35","id":374443963,"node_id":"MDU6SXNzdWUzNzQ0NDM5NjM=","number":35,"title":"Memory leak in pooled server","user":{"login":"animalmutch","id":42073878,"node_id":"MDQ6VXNlcjQyMDczODc4","avatar_url":"https://avatars2.githubusercontent.com/u/42073878?v=4","gravatar_id":"","url":"https://api.github.com/users/animalmutch","html_url":"https://github.com/animalmutch","followers_url":"https://api.github.com/users/animalmutch/followers","following_url":"https://api.github.com/users/animalmutch/following{/other_user}","gists_url":"https://api.github.com/users/animalmutch/gists{/gist_id}","starred_url":"https://api.github.com/users/animalmutch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/animalmutch/subscriptions","organizations_url":"https://api.github.com/users/animalmutch/orgs","repos_url":"https://api.github.com/users/animalmutch/repos","events_url":"https://api.github.com/users/animalmutch/events{/privacy}","received_events_url":"https://api.github.com/users/animalmutch/received_events","type":"User","site_admin":false},"labels":[{"id":40528054,"node_id":"MDU6TGFiZWw0MDUyODA1NA==","url":"https://api.github.com/repos/tcalmant/jsonrpclib/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"tcalmant","id":1540582,"node_id":"MDQ6VXNlcjE1NDA1ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1540582?v=4","gravatar_id":"","url":"https://api.github.com/users/tcalmant","html_url":"https://github.com/tcalmant","followers_url":"https://api.github.com/users/tcalmant/followers","following_url":"https://api.github.com/users/tcalmant/following{/other_user}","gists_url":"https://api.github.com/users/tcalmant/gists{/gist_id}","starred_url":"https://api.github.com/users/tcalmant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcalmant/subscriptions","organizations_url":"https://api.github.com/users/tcalmant/orgs","repos_url":"https://api.github.com/users/tcalmant/repos","events_url":"https://api.github.com/users/tcalmant/events{/privacy}","received_events_url":"https://api.github.com/users/tcalmant/received_events","type":"User","site_admin":false},"assignees":[{"login":"tcalmant","id":1540582,"node_id":"MDQ6VXNlcjE1NDA1ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1540582?v=4","gravatar_id":"","url":"https://api.github.com/users/tcalmant","html_url":"https://github.com/tcalmant","followers_url":"https://api.github.com/users/tcalmant/followers","following_url":"https://api.github.com/users/tcalmant/following{/other_user}","gists_url":"https://api.github.com/users/tcalmant/gists{/gist_id}","starred_url":"https://api.github.com/users/tcalmant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcalmant/subscriptions","organizations_url":"https://api.github.com/users/tcalmant/orgs","repos_url":"https://api.github.com/users/tcalmant/repos","events_url":"https://api.github.com/users/tcalmant/events{/privacy}","received_events_url":"https://api.github.com/users/tcalmant/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-10-26T15:51:20Z","updated_at":"2018-11-14T06:44:16Z","closed_at":"2018-10-26T20:38:56Z","author_association":"NONE","body":"When using PooledJSONRPCServer, there appears to be a memory leak. To see the effect, you can run:\r\n\r\n```python\r\nfrom jsonrpclib.SimpleJSONRPCServer import PooledJSONRPCServer\r\nimport objgraph\r\nimport gc\r\n\r\ndef poll():\r\n    gc.collect()\r\n    objgraph.show_growth()\r\n    return \"Hello world!\"\r\n\r\nserver = PooledJSONRPCServer(('', 8080))\r\nserver.register_function(poll, 'poll')\r\nserver.serve_forever()\r\n```\r\n\r\nAnd poll repeatedly with:\r\n\r\n```python\r\nfrom jsonrpclib import ServerProxy\r\nimport time\r\n\r\nserver = ServerProxy('http://host:port')\r\n\r\nwhile True:\r\n    response = server.poll()\r\n    print(response)\r\n    time.sleep(1)\r\n```\r\n\r\nEvery iteration these extra objects are created and never cleared by the garbage collector:\r\n\r\ndict                           +3\r\nbuiltin_function_or_method      +2\r\nweakref                        +1\r\nEvent                            +1\r\nCondition                        +1\r\ndeque                            +1\r\nThread                           +1\r\n\r\nOver time, with a lot of requests, this is causing applications based on the library to crash.\r\n\r\nThis issue does not affect the SimpleJSONRPCServer.\r\n\r\nIt's an excellent library otherwise. I hope you are able to find a fix, as we've been using it for some time. Please let me know if more information is needed. \r\n\r\nThanks.\r\n"},"comment":{"url":"https://api.github.com/repos/tcalmant/jsonrpclib/issues/comments/438555894","html_url":"https://github.com/tcalmant/jsonrpclib/issues/35#issuecomment-438555894","issue_url":"https://api.github.com/repos/tcalmant/jsonrpclib/issues/35","id":438555894,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODU1NTg5NA==","user":{"login":"tcalmant","id":1540582,"node_id":"MDQ6VXNlcjE1NDA1ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1540582?v=4","gravatar_id":"","url":"https://api.github.com/users/tcalmant","html_url":"https://github.com/tcalmant","followers_url":"https://api.github.com/users/tcalmant/followers","following_url":"https://api.github.com/users/tcalmant/following{/other_user}","gists_url":"https://api.github.com/users/tcalmant/gists{/gist_id}","starred_url":"https://api.github.com/users/tcalmant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcalmant/subscriptions","organizations_url":"https://api.github.com/users/tcalmant/orgs","repos_url":"https://api.github.com/users/tcalmant/repos","events_url":"https://api.github.com/users/tcalmant/events{/privacy}","received_events_url":"https://api.github.com/users/tcalmant/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T06:44:16Z","updated_at":"2018-11-14T06:44:16Z","author_association":"OWNER","body":"Hi,\r\nThanks for the feedback, I really appreciate it.\r\nThat's a good thing to know about the MySQL connector."}}
{"actor":{"display_login":"tcalmant"}}