2013-02-06 55 views
5

一些背景:自從它與Red Gate的SQLPrompt一起發佈以來,我一直在SSMS 2012中遇到這種內存異常(這種異常從未發生在我SSMS 2008R2在同一檯筆記本電腦上)。SSMS 2012 System.OutOfMemoryException(客戶端)和SQL提示(調試信息incl)

我最初每天遇到這些例外(SSMS2012和SQLPrompt),這迫使我關閉並重新打開SSMS(以及我正在處理的所有內容)。幾個月前,我偶然發現一個支持線程,指出可能的插件是原因,所以我卸載了我唯一的插件(SQL Prompt,但沒有卸載開發人員包的其餘部分),並花了很多個月沒有一個異常遠遠少於System.OutOfMemoryException異常。

在2012年發佈SP1後,我再次應用它並重新安裝了SQL Prompt(最新版本),以查看問題是否已得到解決,並且在開發時間的7個小時內我再次遇到臭名昭着的System.OutOfMemoryException。

通過所有這些,我一直用Red Gate打開票據並提交調試日誌,他們在那裏看到異常,但由於內存異常沒有明確列出SQLPrompt,因此他們不會將問題升級到開發團隊。然而,在此特定異常之前,SQL Prompt會在SSMS 2012 IDE(Visual Studio 2010)中引發大量異常(下面列出的一些異常)。我認爲內存異常是SQL Prompt如何管理緩存數據並消耗SSMS的可用內存的問題的症狀,因爲SSMS最終會引發異常。

我已經學會如何推遲這一問題,如何重現它,它直接關係到兩個變量:

  1. 連接和(對象資源管理器和查詢窗口)在SSMS多個實例的工作。即連接到7個實例在2-3小時內捕獲異常。
  2. 從多個實例返回結果集。這包括SSMS用來將信息返回給IDE並將結果返回到各個查詢窗口的查詢。

我連接到快速異常的例子越多,這導致我SQL提示緩存每個實例的所有對象信息。一旦內存異常提出,情況就會降低,直到SSMS崩潰(除非我先關閉它)。

我所追求的是如何收集更多/更好的信息提交給紅門解決這個問題。這是我需要你幫忙的地方。

筆記本:HP精英書8440 RAM:6GB

當前OS: Win 7的企業版SP1的

這裏有一些引起SQL提示異常:

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發生。

感謝您的協助!

+0

可能更適合[RedGate論壇](http://www.red-gate.com/messageboard/index.php) – Andomar

+1

對我來說這個論壇是紅門論壇的超集, d在這裏獲得高級幫助的機會更大。此外,我一直在處理Red Gate支持數月,沒有解決方案。 – artofsql

+0

由於2012年SSMS加上Redgate的SQLPrompt的使用正在部門中傳播,所以這個例外。剛剛切換到使用SSMS 2012與SQLPrompt的同行數據庫開發人員現在正在崩潰。 – artofsql

回答

-1

你可以嘗試限制在這篇文章中描述的列數,看看它是否有幫助嗎? http://redgate.uservoice.com/forums/94413-sql-prompt-feature-suggestions/suggestions/1364757-disable-sql-prompt-on-certain-databases

+0

我試過限制和禁用過去的緩存,但是異常並沒有停止。 – artofsql

+0

這個建議的另一個問題是,我永遠不知道我會在哪些數據庫和服務器上工作,所以爲了這個工作,我必須不斷地微調這個設置。對於銷售專業數據庫工具的工具來說,如果實際的數據庫專業人員在不斷使SSMS崩潰時使用該工具,則無法實現這一目標。 – artofsql

0

對我來說有效的是禁用SQL提示符中的代碼建議,然後我可以運行相同的查詢,然後獲得結果。 然後,我可以在SQL提示符中啓用代碼建議,並且該錯誤暫時保留。

0

此時,RedGate終於承認問題在於SQL提示插件正在與32位SSMS客戶端進行中,並最終導致內存異常的內存窒息。

他們對此問題的答案在一年左右可能會「可能」,當您每年支持付費時,這只是一巴掌。自那之後,我一直拒絕支付對這個問題的2個現有工具帶許可證的進一步支持,這是我自2012年以來一直在爭取的一個問題,直到他們糾正這個問題。如果這影響到你,並且如果可以的話,就做同樣的事情,然後用你的錢包投票來激勵他們使這個修復更具優先性。

如果和那一天到了,我會更新這個回答帖子,並更新SQL提示的內部版本信息,它不再在SSMS.exe的32位內存空間中運行。