{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/3078","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/3078/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/3078/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/3078/events","html_url":"https://github.com/dotnet/roslyn/issues/3078","id":80899309,"number":3078,"title":"Out of memory exception when loading a solution (in v0.7.0 it worked).","user":{"login":"xprzemekw","id":9196393,"avatar_url":"https://avatars.githubusercontent.com/u/9196393?v=3","gravatar_id":"","url":"https://api.github.com/users/xprzemekw","html_url":"https://github.com/xprzemekw","followers_url":"https://api.github.com/users/xprzemekw/followers","following_url":"https://api.github.com/users/xprzemekw/following{/other_user}","gists_url":"https://api.github.com/users/xprzemekw/gists{/gist_id}","starred_url":"https://api.github.com/users/xprzemekw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xprzemekw/subscriptions","organizations_url":"https://api.github.com/users/xprzemekw/orgs","repos_url":"https://api.github.com/users/xprzemekw/repos","events_url":"https://api.github.com/users/xprzemekw/events{/privacy}","received_events_url":"https://api.github.com/users/xprzemekw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-IDE","name":"Area-IDE","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Performance","name":"Performance","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/2","html_url":"https://github.com/dotnet/roslyn/milestones/Unknown","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/2/labels","id":937398,"number":2,"title":"Unknown","description":"This represents work which is not planned for a specific release.\r\n\r\n<!---\r\n@huboard:{\"order\":0.25}\n-->\r\n","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":268,"closed_issues":54,"state":"open","created_at":"2015-01-15T20:46:02Z","updated_at":"2015-05-27T16:28:58Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-05-26T10:23:19Z","updated_at":"2015-05-27T18:18:35Z","closed_at":null,"body":"I have a quite large solution which I automatically refactor using roslyn to migrate ASMX Web Services to WCF. Till now I did it using version 0.7.0 of ROslyn, now I switched to 1.0.0-rc2 and solution stopped loading, OpenSolutionAsync ends with OutOfMemoryException after consuming 1.63GB. On v0.7.0 solution loads eating ~74MB. Something went terribly wrong between releases.\r\n\r\nCall Stack is as follows: \r\n\r\nSystem.AggregateException: One or more errors occurred. ---> System.OutOfMemoryException: Insufficient memory to continue the execution of the program.\r\n   at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)\r\n   at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Boolean isFileStream, Int64 start, Int32 size)\r\n   at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Nullable`1 sizeOpt)\r\n   at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)\r\n   at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)\r\n   at Microsoft.CodeAnalysis.Host.MetadataServiceFactory.Provider.GetReference(String resolvedPath, MetadataReferenceProperties properties)\r\n   at Microsoft.CodeAnalysis.AssemblyReferenceResolver.ResolveReference(String reference, String baseFilePath, MetadataReferenceProperties properties)\r\n   at Microsoft.CodeAnalysis.CommandLineArguments.ResolveMetadataReference(CommandLineReference cmdReference, MetadataReferenceResolver metadataResolver, List`1 diagnosticsOpt, CommonMessageProvider messageProviderOpt)\r\n   at Microsoft.CodeAnalysis.CommandLineArguments.ResolveMetadataReferences(MetadataReferenceResolver metadataResolver, List`1 diagnosticsOpt, CommonMessageProvider messageProviderOpt, List`1 resolved)\r\n   at Microsoft.CodeAnalysis.CommandLineArguments.ResolveMetadataReferences(MetadataReferenceResolver metadataResolver)\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.GetReferences(CSharpCompilerInputs compilerInputs, ProjectInstance executedProject, IEnumerable`1& metadataReferences, IEnumerable`1& analyzerReferences)\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.CreateProjectFileInfo(CSharpCompilerInputs compilerInputs, ProjectInstance executedProject)\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.<GetProjectFileInfoAsync>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<LoadProjectAsync>d__40.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<GetOrLoadProjectAsync>d__39.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<OpenSolutionAsync>d__34.MoveNext()\r\n   --- End of inner exception stack trace ---\r\n   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\r\n   at System.Threading.Tasks.Task`1.get_Result()\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/106021133","html_url":"https://github.com/dotnet/roslyn/issues/3078#issuecomment-106021133","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/3078","id":106021133,"user":{"login":"jasonmalinowski","id":201340,"avatar_url":"https://avatars.githubusercontent.com/u/201340?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonmalinowski","html_url":"https://github.com/jasonmalinowski","followers_url":"https://api.github.com/users/jasonmalinowski/followers","following_url":"https://api.github.com/users/jasonmalinowski/following{/other_user}","gists_url":"https://api.github.com/users/jasonmalinowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmalinowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmalinowski/subscriptions","organizations_url":"https://api.github.com/users/jasonmalinowski/orgs","repos_url":"https://api.github.com/users/jasonmalinowski/repos","events_url":"https://api.github.com/users/jasonmalinowski/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmalinowski/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T18:18:35Z","updated_at":"2015-05-27T18:18:35Z","body":"So this doesn't look like a leak of any MSBuild structures itself -- I see lots of objects in memory but most of them are unrooted. @xprzemekw's stack though might actually be pointing to the problem instead of an unlucky victim though: there's several thousand ModuleMetadatas in memory. Assuming your solution isn't referencing 2000 unique DLLs (seems unlikely :smile:), there must be some broken cache somewhere."}}