{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/PTVS/issues/727","labels_url":"https://api.github.com/repos/Microsoft/PTVS/issues/727/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/PTVS/issues/727/comments","events_url":"https://api.github.com/repos/Microsoft/PTVS/issues/727/events","html_url":"https://github.com/Microsoft/PTVS/issues/727","id":100428353,"number":727,"title":"Memory leak in cross-module class instantiation","user":{"login":"zooba","id":1693688,"avatar_url":"https://avatars.githubusercontent.com/u/1693688?v=3","gravatar_id":"","url":"https://api.github.com/users/zooba","html_url":"https://github.com/zooba","followers_url":"https://api.github.com/users/zooba/followers","following_url":"https://api.github.com/users/zooba/following{/other_user}","gists_url":"https://api.github.com/users/zooba/gists{/gist_id}","starred_url":"https://api.github.com/users/zooba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooba/subscriptions","organizations_url":"https://api.github.com/users/zooba/orgs","repos_url":"https://api.github.com/users/zooba/repos","events_url":"https://api.github.com/users/zooba/events{/privacy}","received_events_url":"https://api.github.com/users/zooba/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/PTVS/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Microsoft/PTVS/labels/Code%20Intelligence","name":"Code Intelligence","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-11T22:48:14Z","updated_at":"2015-08-11T23:23:11Z","closed_at":null,"body":"Given the following two modules, each time `modA` is reanalyzed, memory is leaked until `modB` is reanalyzed.\r\n\r\n`modA.py`:\r\n```python\r\nfrom modB import B\r\n\r\ndef f():\r\n    x = B()\r\n```\r\n\r\n`modB.py`:\r\n```python\r\nclass B:\r\n    def __init__(self):\r\n        self.__init__\r\n```\r\n\r\nIt seems that the call to `modB.B.__init__` from the first analysis sticks around as a dependency of the getattr in `self.__init__`. `modA.f` is a dependency of this call, so it also sticks around, which keeps the entire v1 of `modA`'s analysis in memory."},"comment":{"url":"https://api.github.com/repos/Microsoft/PTVS/issues/comments/130109452","html_url":"https://github.com/Microsoft/PTVS/issues/727#issuecomment-130109452","issue_url":"https://api.github.com/repos/Microsoft/PTVS/issues/727","id":130109452,"user":{"login":"zooba","id":1693688,"avatar_url":"https://avatars.githubusercontent.com/u/1693688?v=3","gravatar_id":"","url":"https://api.github.com/users/zooba","html_url":"https://github.com/zooba","followers_url":"https://api.github.com/users/zooba/followers","following_url":"https://api.github.com/users/zooba/following{/other_user}","gists_url":"https://api.github.com/users/zooba/gists{/gist_id}","starred_url":"https://api.github.com/users/zooba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooba/subscriptions","organizations_url":"https://api.github.com/users/zooba/orgs","repos_url":"https://api.github.com/users/zooba/repos","events_url":"https://api.github.com/users/zooba/events{/privacy}","received_events_url":"https://api.github.com/users/zooba/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T23:23:11Z","updated_at":"2015-08-11T23:23:11Z","body":"Simplified it to just getting a member of `self` - assigning wasn't relevant."}}