Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleted project hierarchy leaked through VisualStudioProjectTracker #10358

Closed
lifengl opened this issue Apr 5, 2016 · 4 comments
Closed

deleted project hierarchy leaked through VisualStudioProjectTracker #10358

lifengl opened this issue Apr 5, 2016 · 4 comments
Assignees
Labels

Comments

@lifengl
Copy link

lifengl commented Apr 5, 2016

Version Used: new version inserted into Dev 15 code

Steps to Reproduce:

  1. Add a CPS barebone project to a solution
  2. Delete the project
  3. Ctrl-Alt-Shift-F12 couple times to force GC
  4. Attach Windbg, check UnconfiguredProjectImpl instance in the memory, they should be released.

Expected Behavior:
no project object hold in the memory after it is deleted.

Actual Behavior:
leak through this chain:

-> 1c35480c Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.DocumentKey
-> 1c24ffe8 Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim.CSharpProjectShimWithServices
-> 1c1a0714 Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker
-> 1c1a0808 System.Collections.Generic.List1[[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker+WorkspaceHostState, Microsoft.VisualStudio.LanguageServices]] -> 23833ad0 Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker+WorkspaceHostState[] -> 1c1a0f78 Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker+WorkspaceHostState -> 1c1a0f90 System.Collections.Generic.HashSet1[[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.AbstractProject, Microsoft.VisualStudio.LanguageServices]]
-> 1c262a80 System.Collections.Generic.HashSet`1+Slot[[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.AbstractProject, Microsoft.VisualStudio.LanguageServices]][]
-> 23c9829c Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim.CSharpProjectShimWithServices
-> 23acc8d0 Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode
-> 23aadeb8 Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl

@gafter gafter added the Area-IDE label Apr 6, 2016
@Pilchie Pilchie added the Bug label Apr 8, 2016
@Pilchie Pilchie added this to the 1.3 milestone Apr 8, 2016
@Pilchie
Copy link
Member

Pilchie commented Apr 8, 2016

@lifengl: Does this repro with regular csproj as well? Is it possible that CPS isn't calling the same method on remove that we normally listen to in order to clean up projects (Mostly ICSharpProjectSite.Disconnect)?

@Pilchie Pilchie modified the milestones: 2.0 (RC), 1.3 May 27, 2016
@heejaechang
Copy link
Contributor

heejaechang commented Jul 8, 2016

adding another repro step. reported by @adriansecchia

Repro on Dev14 Update3

  1.  New WPF C# project
    
  2.  Close all documents, open App.xaml.cs
    
  3.  Close VS
    
  4.  Reopen VS with the project created in #1
    
  5.  Touch project.csproj from the commandline
    
  6.  Reload Project on the dialog that pops up in VS
    
  7.  Repeat from #5
    

This leaks:

            ->  08b802f0 Microsoft.VisualStudio.LanguageServices.RoslynDocumentProvider
            ->  08b8032c System.Collections.Generic.Dictionary`2[[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.DocumentKey, Microsoft.VisualStudio.LanguageServices],[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.DocumentProvider+StandardTextDocument, Microsoft.VisualStudio.LanguageServices]]
            ->  08d61068 System.Collections.Generic.Dictionary`2+Entry[[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.DocumentKey, Microsoft.VisualStudio.LanguageServices],[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.DocumentProvider+StandardTextDocument, Microsoft.VisualStudio.LanguageServices]][]
            ->  124511b4 Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.DocumentKey
            ->  12435eb4 Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim.CSharpProjectShimWithServices
            ->  08b801d4 Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker
            ->  08b802c8 System.Collections.Generic.List`1[[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker+WorkspaceHostState, Microsoft.VisualStudio.LanguageServices]]
            ->  08b802e0 Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker+WorkspaceHostState[]
            ->  08b80ab8 Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectTracker+WorkspaceHostState
            ->  08b80ad0 System.Collections.Generic.HashSet`1[[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.AbstractProject, Microsoft.VisualStudio.LanguageServices]]
            ->  123c7898 System.Collections.Generic.HashSet`1+Slot[[Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.AbstractProject, Microsoft.VisualStudio.LanguageServices]][]
            ->  123e92cc Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim.CSharpProjectShimWithServices

The CSharpProjectShimWithServices grows by 1 each iteration. There is only 1 VisualStudioProjectTracker+WorkspaceHostState

@heejaechang
Copy link
Contributor

link to specific customer comments #7082 (comment)

@davidroth
Copy link

davidroth commented Jul 12, 2016

@jasonmalinowski As written in #7082 , it would be great if this could also be fixed in roslyn 1.4 (VS2015) because I think this is the reason I still have to restart VS some times a day because of excessive memory usage due to git branch switching or git rebasing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants