gpt4 book ai didi

sql - SSMS 2012 System.OutOfMemoryException(客户端)和 SQL 提示(包括调试信息)

转载 作者:行者123 更新时间:2023-12-03 18:04:10 25 4
gpt4 key购买 nike

一些背景:自从 SSMS 2012 与 Red Gate 的 SQLPrompt 一起发布以来,我一直在 SSMS 2012 中遇到此内存异常(此异常从未发生在同一台笔记本电脑上的 SSMS 2008R2 中)。

我最初每天都会遇到这些异常(SSMS2012 和 SQLPrompt),这迫使我关闭并重新打开 SSMS(以及我正在处理的所有内容)。几个月前,我偶然发现了一个支持线程,该线程指出可能的附加组件是原因,所以我 已卸载 我唯一的附加组件(SQL 提示,但没有卸载开发人员包的其余部分)并且几个月没有出现任何异常,更不用说 System.OutOfMemoryException 异常了。

2012 年发布 SP1 后,我应用它并再次重新安装 SQL Prompt(最新版本)以查看问题是否已得到解决,在开发时间的 7 小时内,我再次遇到了臭名昭著的 System.OutOfMemoryException。

在所有这些过程中,我一直在使用 Red Gate 开票,并在他们看到异常的地方提交调试日志,但由于内存异常没有明确列出 SQLPrompt,他们不会将问题上报给开发团队。然而,在此特定异常之前,SQL Prompt 在 SSMS 2012 IDE (Visual Studio 2010) 中引发了许多异常(一些在下面列出)。我相信内存异常是 SQL Prompt 如何管理缓存数据并占用 SSMS 的可用内存的问题的征兆,这最终会引发异常。

我已经学会了如何推迟这个问题以及如何重现它,它与两个变量直接相关:

  • 在 SSMS(对象资源管理器和查询窗口)中连接和处理多个实例。 IE。连接到 7 个实例在 2-3 小时内消除了异常。
  • 从多个实例返回结果集。这包括 SSMS 用于将信息返回到 IDE 的查询以及返回到各个查询窗口的结果。

  • 我连接到的实例越多,引发异常的速度就越快,这导致 SQL Prompt 缓存每个实例的所有对象信息。一旦引发内存异常,情况就会下降,直到 SSMS 完全崩溃(除非我先关闭它)。

    我所追求的是如何收集更多/更好的信息以提交给 Red Gate 以纠正此问题。这就是我需要你帮助的地方。

    笔记本电脑:HP Elite book 8440
    内存:6GB

    当前操作系统:
    Win 7 Enterprise Ed Sp1

    以下是 SQL Prompt 引起的一些异常:
    System.ArgumentOutOfRangeException "Specified argument was out of the range of valid values."   

    Microsoft.VisualStudio.Text.Implementation.BinaryStringRebuilder.GetLineNumberFromPosition(N/A,N/A)
    Microsoft.VisualStudio.Text.Implementation.TextSnapshot.GetLineFromPosition(Microsoft.VisualStudio.Text.Implementation.TextSnapshot,N/A)
    Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.GetLineIndexOfPosition(N/A,System.Int32,System.Int32&,System.Int32&)
    RedGate.SQLPrompt.CommonVS.Editor.VSScriptProvider.PositionFromIndex(RedGate.SQLPrompt.CommonVS.Editor.VSScriptProvider,System.Int32)
    RedGate.SqlPrompt.Metadata.Script.ScriptProviderBase.GetText(RedGate.SQLPrompt.CommonVS.Editor.VSScriptProvider,System.Int32,System.Int32)
    RedGate.SqlPrompt.Engine.NewEngine.SqlPromptEngine.GetCandidates(RedGate.SqlPrompt.Engine.NewEngine.SqlPromptEngine,System.Int32)
    RedGate.SqlPrompt.Engine.PromptEngineEmulator.get_GetSuggestions(RedGate.SqlPrompt.Engine.PromptEngineEmulator)
    RedGate.SqlPrompt.Engine.AutoCompleter.m_FilterChanged(RedGate.SqlPrompt.Engine.AutoCompleter,RedGate.SqlPrompt.Engine.PromptEngineEmulator,System.EventArgs)
    RedGate.SqlPrompt.Engine.PromptEngineEmulator.OnFilterChanged(RedGate.SqlPrompt.Engine.PromptEngineEmulator)
    RedGate.SqlPrompt.Engine.PromptEngineEmulator.set_Index(RedGate.SqlPrompt.Engine.PromptEngineEmulator,System.Int32)
    RedGate.SqlPrompt.Engine.PromptEngineEmulator.set_CaretPosition(RedGate.SqlPrompt.Engine.PromptEngineEmulator,N/A)
    RedGate.SQLPrompt.CommonUI.Editor.EditorWindowBase.SetEngineCaretPosition(RedGate.SQLPrompt.SSMSUI.SSMSEditorWindow,N/A)
    RedGate.SQLPrompt.CommonUI.Editor.EditorWindowBase.UpdateUIPrompts(RedGate.SQLPrompt.SSMSUI.SSMSEditorWindow)
    RedGate.SQLPrompt.CommonVS.Editor.VSEditorWindow.OnTextViewCommandExec(RedGate.SQLPrompt.SSMSUI.SSMSEditorWindow,RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor,RedGate.SQLPrompt.CommonVS.Editor.CommandExecEventArgs)
    RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor.AfterCommandExecute(RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor,RedGate.SQLPrompt.CommonVS.Editor.CommandExecEventArgs)
    RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor..(RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor.)
    RedGate.SQLPrompt.CommonUI.Utils.ErrorDialog.Do(System.Action)
    RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor.(RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor,System.Guid&,System.Uint32,System.Uint32,System.IntPtr,System.IntPtr)
    RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor..(RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor.,System.Guid&,System.Uint32,System.Uint32,System.IntPtr,System.IntPtr)
    Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(N/A,N/A,N/A,N/A,N/A,N/A)

    System.ArgumentException 00:05:14.7510000 "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

    #mMc.#JQub.#OQub(#mMc.#JQub,N/A,System.Uint32,#mMc.#k3ub&)
    #mMc.#JQub.#z26.#8Di(#mMc.#JQub.#z26)
    RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.Do(RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog,System.Action,System.Predicate`1<System.Exception>,System.Boolean)
    RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.Do(RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog,System.Action)
    RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog.Do(System.Action)

    这是内存异常:

    Exception thrown in result set
    System.OutOfMemoryException <null>  

    System.Text.StringBuilder.set_Capacity(System.Text.StringBuilder,N/A)
    Microsoft.SqlServer.Management.QueryExecution.QEDiskStorageView.set_MaxNumBytesToDisplay(N/A,N/A)
    Microsoft.SqlServer.Management.QueryExecution.QEDiskDataStorage.GetStorageView(N/A)
    Microsoft.SqlServer.Management.QueryExecution.QEResultSet.StartRetrievingData(Microsoft.SqlServer.Management.QueryExecution.QEResultSet,System.Int32,N/A)
    Microsoft.SqlServer.Management.QueryExecution.ResultSetAndGridContainer.StartRetrievingData(N/A,N/A,N/A)
    Microsoft.SqlServer.Management.QueryExecution.ResultsToGridBatchConsumer.OnNewResultSet(Microsoft.SqlServer.Management.QueryExecution.ResultsToGridBatchConsumer,N/A,N/A)
    Microsoft.SqlServer.Management.QueryExecution.QESQLBatch.ProcessResultSet(Microsoft.SqlServer.Management.QueryExecution.QESQLBatch,N/A)
    Microsoft.SqlServer.Management.QueryExecution.QESQLBatch.DoBatchExecution(Microsoft.SqlServer.Management.QueryExecution.QESQLBatch,System.Data.SqlClient.SqlConnection,N/A)
    Microsoft.SqlServer.Management.QueryExecution.QESQLBatch.Execute(N/A,N/A,N/A)
    Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec.DoBatchExecution(Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec,Microsoft.SqlServer.Management.QueryExecution.QESQLBatch)
    Microsoft.SqlServer.Management.QueryExecution.QESQLExec.ExecuteBatchCommon(Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec,N/A,N/A,System.Boolean&)
    Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec.ExecuteBatchHelper(N/A,N/A,N/A,N/A)
    Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec.ProcessBatch(N/A,N/A,N/A)
    .BatchParser.ThunkCommandExecuter.ProcessBatch(N/A,N/A,N/A)

    再次声明,我不知道其他异常是否相关,但内存异常 只有安装 SQL Prompt 时发生。

    谢谢你的协助!

    最佳答案

    对我有用的是在 SQL 提示中禁用代码建议,然后我可以运行相同的查询,然后获得结果。
    然后我可以在 SQL 提示中启用代码建议,错误会消失一段时间。

    关于sql - SSMS 2012 System.OutOfMemoryException(客户端)和 SQL 提示(包括调试信息),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14738530/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com