{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/2811","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/2811/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/2811/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/2811/events","html_url":"https://github.com/dotnet/roslyn/pull/2811","id":76885238,"number":2811,"title":"Don't leak Workspace objects from AnalyzerAndOptions","user":{"login":"JohnHamby","id":10982715,"avatar_url":"https://avatars.githubusercontent.com/u/10982715?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnHamby","html_url":"https://github.com/JohnHamby","followers_url":"https://api.github.com/users/JohnHamby/followers","following_url":"https://api.github.com/users/JohnHamby/following{/other_user}","gists_url":"https://api.github.com/users/JohnHamby/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnHamby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnHamby/subscriptions","organizations_url":"https://api.github.com/users/JohnHamby/orgs","repos_url":"https://api.github.com/users/JohnHamby/repos","events_url":"https://api.github.com/users/JohnHamby/events{/privacy}","received_events_url":"https://api.github.com/users/JohnHamby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Analyzers","name":"Area-Analyzers","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-05-15T23:00:56Z","updated_at":"2015-05-16T04:00:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/2811","html_url":"https://github.com/dotnet/roslyn/pull/2811","diff_url":"https://github.com/dotnet/roslyn/pull/2811.diff","patch_url":"https://github.com/dotnet/roslyn/pull/2811.patch"},"body":"Prevent AnalyzerAndOptions objects from holding on to Workspace objects from that can be embedded in WorkspaceAnalyzerOptions objects.\r\n\r\nFixes #2777.\r\n\r\n@heejaechang @mavasani @srivatsn might be interested."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/102569559","html_url":"https://github.com/dotnet/roslyn/pull/2811#issuecomment-102569559","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/2811","id":102569559,"user":{"login":"mavasani","id":10605811,"avatar_url":"https://avatars.githubusercontent.com/u/10605811?v=3","gravatar_id":"","url":"https://api.github.com/users/mavasani","html_url":"https://github.com/mavasani","followers_url":"https://api.github.com/users/mavasani/followers","following_url":"https://api.github.com/users/mavasani/following{/other_user}","gists_url":"https://api.github.com/users/mavasani/gists{/gist_id}","starred_url":"https://api.github.com/users/mavasani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavasani/subscriptions","organizations_url":"https://api.github.com/users/mavasani/orgs","repos_url":"https://api.github.com/users/mavasani/repos","events_url":"https://api.github.com/users/mavasani/events{/privacy}","received_events_url":"https://api.github.com/users/mavasani/received_events","type":"User","site_admin":false},"created_at":"2015-05-16T04:00:34Z","updated_at":"2015-05-16T04:00:34Z","body":"@heejaechang I am not sure I understand how you are defining a leak here. Prior to John's fix, the entry generated in compilationScope map could hold onto preview Workspace for lifetime of analyzer, which for host analyzers is entire VS session. John's change fixes the leak. However, even when preview workspace is disposed, the host analyzer still lives on for entire VS session. If a new preview workspace is created, and it asks for host analyzer's actions for the same compilation as previously disposed compilation had asked, we should not re-execute RegisterCompilationStartAction for the same analyzer instance for the same compilation. The entry created in compilationScopeMap must live for the lifetime of analyzer, not the lifetime of workspace which happened to first ask for its entire actions, that is not a leak but a necessity for the analyzer execution semantics that we have defined."}}