roslyn: RoslynCodeAnalysisService32.exe OutOfMemoryException after updating VS2017 to v15.3

Visual Studio 2017 (15.3.0)

When working on a relatively large solution (~120 C# projects, with one large ASP.NET app), RoslynCodeAnalysisService32.exe crashes at seemingly random times after searching for references of a class. Visual Studio then shows a yellow bar with a message: “Unfortunately, a process used by Visual Studio has encountered an unrecoverable error. We recommend saving your work, and then closing and restarting Visual Studio”.

This hasn’t happened before the 15.3 update.

The Event Log entry looks like this:

Application: ServiceHub.RoslynCodeAnalysisService32.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException
   at System.Threading.Tasks.TaskExceptionHolder.AddFaultException(System.Object)
   at System.Threading.Tasks.TaskExceptionHolder.Add(System.Object, Boolean)
   at System.Threading.Tasks.Task.AddException(System.Object, Boolean)
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetException(System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetException(System.Exception)
   at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine+<ProcessProjectAsync>d__25.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.AwaitTaskContinuation+<>c.<ThrowAsyncIfNecessary>b__18_0(System.Object)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 34 (16 by maintainers)

Most upvoted comments

we internally uses SQLite and we had some issue where we cause it to consume a lot of memory causing OOM. the PR is about fixing that problem.