OutOfMemoryException

peter ehpeter eh Posts: 17 Bronze 2
After working several days with SSMS I get the following error message when I want to commit changes on a database with > 2000 objects. Smaller databases still work with Source Control, all other functions of SSMS work too.
(Windows 7 64bit, SSMS 10.50.1720.0, Source Control 1.0.1.13)

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 835, offset:17 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 846, offset:14 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1357, offset:112 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1359, offset:21 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1504, offset:13
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.String.ConcatArray(String[] values, Int32 totalLength)
at System.String.Concat(String[] values)
at System.Exception.ToString()
at System.Exception.ToString()
at System.Exception.ToString()
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at RedGate.Shared.Utils.Logging.Logger.Log(LogLevel level, String component, String message, Object[] args)
at RedGate.Shared.Utils.Logging.Logger.Log(LogLevel level, String component, Exception e, String message)
at #QEc.#REc.#8d(LogLevel level, Exception e, String message)
at #QEc.#REc.Error(Exception e, String message, Object[] args)
at RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.Do(Action toDo, Predicate`1 shouldReportPredicate, Boolean rethrow)
at RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.DoWithObviousExceptionsRethrowAll(Action action)
at RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog.DoWithObviousExceptionsRethrowAll(Action action)
at #JLc.#PLc.#CTc(ICancellableOperation`1 operation, Object token)

second try, now suddenly more lines and some text with german message ...

RedGate.SQLSourceControl.Engine.SqlCompareException: Eine Ausnahme vom Typ "System.OutOfMemoryException" wurde ausgelöst. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3957, offset:0 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3958, offset:42 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3911, offset:317 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3896, offset:1433 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3896, offset:1078 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3893, offset:8 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 19, offset:77 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 23, offset:40 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3736, offset:117 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3710, offset:452 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 539, offset:477 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2048, offset:37 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 314, offset:38 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1985, offset:0 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 313, offset:38 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 316, offset:38 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 952, offset:61 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 938, offset:89 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 950, offset:14 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2171, offset:58 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1926, offset:63 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 218, offset:548 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2168, offset:1084 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1989, offset:18 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 314, offset:38 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 318, offset:38 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1765, offset:213 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2165, offset:63 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1764, offset:99 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1763, offset:52 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1229, offset:25 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1226, offset:0 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2065, offset:0 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1928, offset:117 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 203, offset:11 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 248, offset:137 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 724, offset:26 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 2314, offset:31 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1357, offset:120 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1359, offset:21 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1504, offset:13
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at RedGate.SQLCompare.Rewriter.Analysis.Analyser`1.WaitForBackgroundThread()
at #Eyg.#Gyg.#CGh(FileInfo file)
at #Eyg.#Gyg.#vl()
at RedGate.SQLCompare.Engine.Database.Register(String path, ScriptDatabaseInformation dbinfo, Options options)
at #G3c.#L3c.#t.#u3.#i4c()
at #oEc.#7Jf.#hKf(ICancellableOperationStatus status, ICancellable database, Action action)
at #oEc.#7Jf.#t.#B3.#sKf()
at #oEc.#7Jf.#gKf(Action action)
--- End of inner exception stack trace ---

Server stack trace:
bei #oEc.#7Jf.#gKf(Action action)
bei #oEc.#7Jf.#jKf(ICancellableOperationStatus status, ICancellable database, Action action)
bei #G3c.#L3c.#e4c(String path, #M3c args)
bei #G3c.#K3c.#83c(String path, TArg argument)
bei #G3c.#L3c.#f6c(String path, ScriptDatabaseInformation folderOptions, Options options, ICancellableOperationStatus status)
bei #oEc.#i7c.#t.#9Jf.#t.#2Db.#TSi()
bei RedGate.SQLSourceControl.Engine.Cancellables.CancellableOperation.#t.#izb.#j5f()
bei System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
bei System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
bei System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at RedGate.SQLSourceControl.Engine.Action.EndInvoke(IAsyncResult result)
at RedGate.SQLSourceControl.Engine.Cancellables.CancellableOperation.#zIc(ICancellableOperationStatus status, Pair`2[] labelledActions)
at #oEc.#i7c.#t.#9Jf.#SSi()
at #oEc.#7Jf.#t.#9Jf.#uKf()
at #oEc.#7Jf.#hKf(ICancellableOperationStatus status, ICancellable database, Action action)
at #oEc.#7Jf.#lKf[T](ICancellableOperationStatus status, ICancellable database, Func`1 function)
at #oEc.#i7c.#QSi[TDiffType](ICancellableOperationStatus status, IReadOnlySourceControlServerCallBacks sourceControlUserCallBacks, ScriptDatabaseInformation folderOptions)
at #oEc.#i7c.#t.#z2.#hOi()
at #oEc.#i7c.#bOi[TDiffType](ICancellableOperationStatus status, Func`1 innerBuild)
at #oEc.#i7c.#q1f(ICancellableOperationStatus status, IReadOnlySourceControlServerCallBacks sourceControlUserCallBacks, ScriptDatabaseInformation folderOptions)
at #oEc.#4Ec.#z7c(ICancellableOperationStatus status, IReadOnlySourceControlServerCallBacks sourceControlUserCallBacks)
at #oEc.#4Ec.#7Jc(ICancellableOperationStatus status, IReadOnlySourceControlServerCallBacks sourceControlUserCallBacks)
at #oEc.#4Ec.#t.#A2.#D7c(ICancellableOperationStatus status)
at #eEc.#iEc.#t.#u3.#k5f()
at RedGate.SQLSourceControl.Engine.Cancellables.CancellableOperationBase.InvokeWithTracker(Action action)
at #eEc.#iEc.Invoke()
at #JLc.#Qlg.Invoke()
at #JLc.#PLc.#t.#Jfb.#EJf()
at RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.Do(Action toDo, Predicate`1 shouldReportPredicate, Boolean rethrow)
at RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.DoWithObviousExceptionsRethrowAll(Action action)
at RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog.DoWithObviousExceptionsRethrowAll(Action action)
at #JLc.#PLc.#CTc(ICancellableOperation`1 operation, Object token)

Comments

  • peter ehpeter eh Posts: 17 Bronze 2
    After closing some query tabs in SSMS, Source Control worked again with the "> 2000 object database". There are now only 5 query tabs with small resultsets open, not enough for my usual workload ...
    How much memory does Source Control need to display the "Commit Changes" tab for a "> 2000 objects database"?
    Did I found a memory leak in Source Control or SSMS?
  • I forgot to update this post with the outcome of the issue.

    The problem was that having a large number of queries open in SSMS can cause memory issues. Balancing the open queries using multiple SSMS instances is one workaround, but SQL Source control will only work from the first instance.

    Supporting multiple instances of SSMS isn't currently on the roadmap, but you can vote for the feature here:
    http://redgate.uservoice.com/forums/390 ... ?ref=title

    In the mean time, you could have multiple instances of SSMS open, but just make sure you do all your source control tasks through the first instance.

    I hope this helps anybody experiencing this issue.
    Chris
Sign In or Register to comment.