Bug 10181 - Out of Memory Exception while using MD
Summary: Out of Memory Exception while using MD
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 3.1.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-02-08 17:15 UTC by Stephen Shaw
Modified: 2013-05-30 01:00 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Stephen Shaw 2013-02-08 17:15:24 UTC
I'm not entirely sure what I did to get this. I noticed it in the console after quitting MD. Here are some of the system specs:

Mac Pro  (Mid 2010)
2 x 2.66 GHz 6-core Intel Xeon
32 GB 1333 MHz DDR3 ECC
OS X 10.8.2



Here is the stack trace:

Server stack trace: 
  at MonoDevelop.Projects.Formats.MSBuild.BuildEngine.RunSTA (System.Threading.ThreadStart ts) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.ProjectBuilder.RunTarget (System.String target, MonoDevelop.Projects.Formats.MSBuild.ProjectConfigurationInfo[] configurations, ILogWriter logWriter, MSBuildVerbosity verbosity) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.RemotingServices:InternalExecute (System.Reflection.MethodBase,object,object[],object[]&)
  at System.Runtime.Remoting.RemotingServices.InternalExecuteMessage (System.MarshalByRefObject target, IMethodCallMessage reqMsg) [0x00000] in <filename unknown>:0 

Exception rethrown at [0]: 
 ---> System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.Projects.Formats.MSBuild.MDConsoleLogger.ProjectFinishedHandler (System.Object sender, Microsoft.Build.Framework.ProjectFinishedEventArgs args) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.BuildEvent.ExecuteFinishedHandler (Microsoft.Build.Framework.BuildStatusEventArgs finished_args) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.MDConsoleLogger.PopEvent[BuildFinishedEventArgs] (Microsoft.Build.Framework.BuildFinishedEventArgs finished_args) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.MDConsoleLogger.BuildFinishedHandlerActual (Microsoft.Build.Framework.BuildFinishedEventArgs args) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.MDConsoleLogger.BuildFinishedHandler (System.Object sender, Microsoft.Build.Framework.BuildFinishedEventArgs args) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.BuildEngine.EventSource.FireBuildFinished (System.Object sender, Microsoft.Build.Framework.BuildFinishedEventArgs bfea) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.BuildEngine.Engine.LogBuildFinished (Boolean succeeded) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.BuildEngine.Engine.UnregisterAllLoggers () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.ProjectBuilder+<RunTarget>c__AnonStorey1.<>m__1 () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.BuildEngine.STARunner () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x00000] in <filename unknown>:0 
ERROR [2013-02-08 15:04:49Z]: System.Exception: MSBuild operation failed

Server stack trace: 
  at MonoDevelop.Projects.Formats.MSBuild.BuildEngine.RunSTA (System.Threading.ThreadStart ts) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.ProjectBuilder.RunTarget (System.String target, MonoDevelop.Projects.Formats.MSBuild.ProjectConfigurationInfo[] configurations, ILogWriter logWriter, MSBuildVerbosity verbosity) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.RemotingServices:InternalExecute (System.Reflection.MethodBase,object,object[],object[]&)
  at System.Runtime.Remoting.RemotingServices.InternalExecuteMessage (System.MarshalByRefObject target, IMethodCallMessage reqMsg) [0x00000] in <filename unknown>:0 

Exception rethrown at [0]: 
 ---> System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.Projects.Formats.MSBuild.MDConsoleLogger.ProjectFinishedHandler (System.Object sender, Microsoft.Build.Framework.ProjectFinishedEventArgs args) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.BuildEvent.ExecuteFinishedHandler (Microsoft.Build.Framework.BuildStatusEventArgs finished_args) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.MDConsoleLogger.PopEvent[BuildFinishedEventArgs] (Microsoft.Build.Framework.BuildFinishedEventArgs finished_args) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.MDConsoleLogger.BuildFinishedHandlerActual (Microsoft.Build.Framework.BuildFinishedEventArgs args) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.MDConsoleLogger.BuildFinishedHandler (System.Object sender, Microsoft.Build.Framework.BuildFinishedEventArgs args) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.BuildEngine.EventSource.FireBuildFinished (System.Object sender, Microsoft.Build.Framework.BuildFinishedEventArgs bfea) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.BuildEngine.Engine.LogBuildFinished (Boolean succeeded) [0x00000] in <filename unknown>:0 
  at Microsoft.Build.BuildEngine.Engine.UnregisterAllLoggers () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.ProjectBuilder+<RunTarget>c__AnonStorey1.<>m__1 () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.BuildEngine.STARunner () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x00000] in <filename unknown>:0 
CreateThread: Error creating native thread handle Resource temporarily unavailable (35)
ves_icall_System_Threading_Thread_Thread_internal: CreateThread error 0x1f
-----------------Serialize stack trace:
   at System.Environment.get_StackTrace()
   at MonoDevelop.Ide.TypeSystem.TypeSystemService.SerializeObject(System.String path, System.Object obj)
   at MonoDevelop.Ide.TypeSystem.TypeSystemService.StoreProjectCache(MonoDevelop.Projects.Project project, MonoDevelop.Ide.TypeSystem.ProjectContentWrapper wrapper)
   at MonoDevelop.Ide.TypeSystem.TypeSystemService.UnloadProject(MonoDevelop.Projects.Project project)
   at MonoDevelop.Ide.TypeSystem.TypeSystemService.<Unload>m__20A(MonoDevelop.Projects.Project project)
   at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey3D`1[[MonoDevelop.Projects.Project, MonoDevelop.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null]].<>m__4E(MonoDevelop.Projects.Project e, System.Threading.Tasks.ParallelLoopState s, System.Object l)
   at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey3C`2[[MonoDevelop.Projects.Project, MonoDevelop.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<>m__4C()
   at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke(System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context)
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.ThreadStart()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.Tasks.TpScheduler.<QueueTask>m__73(System.Object l)
   at System.Threading.Thread.StartInternal()
ERROR [2013-02-08 15:04:56Z]: Error while writing type system cache. (object:ICSharpCode.NRefactory.CSharp.CSharpProjectContent)
System.OutOfMemoryException: Out of memory
  at (wrapper managed-to-native) string:InternalAllocateStr (int)
  at System.Text.StringBuilder.InternalEnsureCapacity (Int32 size) [0x00000] in <filename unknown>:0 
  at System.Text.StringBuilder.Append (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.LogView+QueuedTextWrite.Write (System.String s) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.LogView.WriteText (System.String text) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.LogTextWriter.Write (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.AggregatedProgressMonitor.OnWriteLog (System.String text) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.LogTextWriter.Write (System.String value) [0x00000] in <filename unknown>:0 
  at System.IO.TextWriter.WriteLine (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.LogWriter.WriteLine (System.String text) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.RemotingServices:InternalExecute (System.Reflection.MethodBase,object,object[],object[]&)
  at System.Runtime.Remoting.RemotingServices.InternalExecuteMessage (System.MarshalByRefObject target, IMethodCallMessage reqMsg) [0x00000] in <filename unknown>:0 
-----------------Serialize stack trace:
   at System.Environment.get_StackTrace()
   at MonoDevelop.Ide.TypeSystem.TypeSystemService.SerializeObject(System.String path, System.Object obj)
   at MonoDevelop.Ide.TypeSystem.TypeSystemService.StoreProjectCache(MonoDevelop.Projects.Project project, MonoDevelop.Ide.TypeSystem.ProjectContentWrapper wrapper)
   at MonoDevelop.Ide.TypeSystem.TypeSystemService.UnloadProject(MonoDevelop.Projects.Project project)
   at MonoDevelop.Ide.TypeSystem.TypeSystemService.<Unload>m__20A(MonoDevelop.Projects.Project project)
   at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey3D`1[[MonoDevelop.Projects.Project, MonoDevelop.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null]].<>m__4E(MonoDevelop.Projects.Project e, System.Threading.Tasks.ParallelLoopState s, System.Object l)
   at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey3C`2[[MonoDevelop.Projects.Project, MonoDevelop.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<>m__4C()
   at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke(System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context)
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.ThreadStart()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.Tasks.TpScheduler.<QueueTask>m__73(System.Object l)
   at System.Threading.Thread.StartInternal()
ERROR [2013-02-08 15:04:56Z]: Error while writing type system cache. (object:ICSharpCode.NRefactory.CSharp.CSharpProjectContent)
System.OutOfMemoryException: Out of memory
  at (wrapper managed-to-native) string:InternalAllocateStr (int)
  at System.Text.StringBuilder.InternalEnsureCapacity (Int32 size) [0x00000] in <filename unknown>:0 
  at System.Text.StringBuilder.Append (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.LogView+QueuedTextWrite.Write (System.String s) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.LogView.WriteText (System.String text) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.LogTextWriter.Write (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.AggregatedProgressMonitor.OnWriteLog (System.String text) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.LogTextWriter.Write (System.String value) [0x00000] in <filename unknown>:0 
  at System.IO.TextWriter.WriteLine (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.LogWriter.WriteLine (System.String text) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.RemotingServices:InternalExecute (System.Reflection.MethodBase,object,object[],object[]&)
  at System.Runtime.Remoting.RemotingServices.InternalExecuteMessage (System.MarshalByRefObject target, IMethodCallMessage reqMsg) [0x00000] in <filename unknown>:0 
ERROR [2013-02-08 15:05:04Z]: An unhandled exception has occured. Terminating MonoDevelop? False
System.AggregateException: One or more errors occured ---> System.OutOfMemoryException: Out of memory
  at (wrapper managed-to-native) string:InternalAllocateStr (int)
  at System.Text.StringBuilder.InternalEnsureCapacity (Int32 size) [0x00000] in <filename unknown>:0 
  at System.Text.StringBuilder.Append (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.LogView+QueuedTextWrite.Write (System.String s) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.LogView.WriteText (System.String text) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.LogTextWriter.Write (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.AggregatedProgressMonitor.OnWriteLog (System.String text) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.LogTextWriter.Write (System.String value) [0x00000] in <filename unknown>:0 
  at System.IO.TextWriter.WriteLine (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.LogWriter.WriteLine (System.String text) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.RemotingServices:InternalExecute (System.Reflection.MethodBase,object,object[],object[]&)
  at System.Runtime.Remoting.RemotingServices.InternalExecuteMessage (System.MarshalByRefObject target, IMethodCallMessage reqMsg) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
 --> (Inner exception 0) System.OutOfMemoryException: Out of memory
  at (wrapper managed-to-native) string:InternalAllocateStr (int)
  at System.Text.StringBuilder.InternalEnsureCapacity (Int32 size) [0x00000] in <filename unknown>:0 
  at System.Text.StringBuilder.Append (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.LogView+QueuedTextWrite.Write (System.String s) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.Gui.Components.LogView.WriteText (System.String text) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.LogTextWriter.Write (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.AggregatedProgressMonitor.OnWriteLog (System.String text) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Core.ProgressMonitoring.LogTextWriter.Write (System.String value) [0x00000] in <filename unknown>:0 
  at System.IO.TextWriter.WriteLine (System.String value) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Projects.Formats.MSBuild.LogWriter.WriteLine (System.String text) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Runtime.Remoting.RemotingServices:InternalExecute (System.Reflection.MethodBase,object,object[],object[]&)
  at System.Runtime.Remoting.RemotingServices.InternalExecuteMessage (System.MarshalByRefObject target, IMethodCallMessage reqMsg) [0x00000] in <filename unknown>:0
Comment 1 Mike Krüger 2013-05-30 01:00:18 UTC
I use now a shared serializer - that should lower the memory consumption.