System.OutOfMemoryException

Julian C. asked on April 28, 2022 22:36

Running Kentico v10 successfully & happily for the past 4 years. Web server and DB server hosted on Azure.

Suddenly, for the past days, page editors cannot save pages (create new versions).

System.OutOfMemoryException error is thrown.

I noticed our DB didn't change recently, not sure if it's related. Stuck at 40GB (huge!?) Our DBA confirmed the DB server has plenty of memory. So is the web server.

Any idea what's happening?

Here's the full error we're getting: An error occurred when saving data. Please see event log for more details. Message: Exception of type 'System.OutOfMemoryException' was thrown. Exception type: System.OutOfMemoryException Stack trace: at System.Data.SqlClient.TdsParserStateObject.TryReadPlpBytes(Byte[]& buff, Int32 offst, Int32 len, Int32& totalBytesRead) at System.Data.SqlClient.TdsParser.TryReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj, SqlCommandColumnEncryptionSetting columnEncryptionOverride, String columnName) at System.Data.SqlClient.SqlDataReader.TryReadColumnInternal(Int32 i, Boolean readHeaderOnly) at System.Data.SqlClient.SqlDataReader.TryReadColumn(Int32 i, Boolean setTimeout, Boolean allowPartiallyReadColumn) at System.Data.SqlClient.SqlDataReader.GetValues(Object[] values) at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values) at System.Data.ProviderBase.SchemaMapping.LoadDataRow() at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction) at CMS.DataEngine.AbstractDataConnection.CMS.DataEngine.IDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction) at CMS.DataEngine.GeneralConnection.RunQuery(QueryParameters query) at CMS.DataEngine.GeneralConnection.RunQueryWithRetry(QueryParameters query, Int32 retryCount) at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query) at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query, Int32& totalRecords) at CMS.DataEngine.DataQueryBase1.GetDataFromDBInternal() at CMS.DataEngine.DataQueryBase1.GetDataFromDB() at CMS.DataEngine.DataQueryBase1.GetData() at CMS.DataEngine.DataQueryBase1.get_Result() at CMS.DataEngine.ObjectQueryBase2.GetResults(IDataQuery query, Int32& totalRecords) at CMS.DataEngine.DataQueryBase1.GetDataFromDB() at CMS.DataEngine.DataQueryBase1.GetData() at CMS.DataEngine.ObjectQueryBase2.GetData() at CMS.DataEngine.DataQueryBase1.get_Result() at CMS.DataEngine.ObjectQueryBase2.EnsureTypedResult() at CMS.DataEngine.AbstractInfoProvider3.GetDataByColumn[T](String columnName, T value, String columns) at CMS.DataEngine.AbstractInfoProvider3.GetInfoByColumn[T](String columnName, T value) at CMS.DataEngine.AbstractInfoProvider3.GetInfoById(Int32 id, Boolean useHashtable) at CMS.DataEngine.AbstractInfoProvider3.BoundGetInfoById(Int32 id) at CMS.DataEngine.BaseAbstractInfoProvider.GetInfoById(String objectType, Int32 id, Boolean exceptionIfObjTypeNotFound) at CMS.DataEngine.BaseInfo.GetParent() at CMS.DataEngine.BaseInfo.get_ObjectParent() at CMS.DataEngine.BaseInfo.TouchParent() at CMS.Synchronization.SynchronizationHelper.TouchParent(BaseInfo infoObj, TaskTypeEnum taskType) at CMS.Synchronization.SynchronizationHandlers.Delete_After(Object sender, ObjectEventArgs e) at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler1 h, TArgs e) at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List1 list, TArgs e, Boolean important) at CMS.Base.AdvancedHandler2.RaiseAfter(TArgs e) at CMS.Base.AdvancedHandler2.RaiseAfter(TArgs e) at CMS.Base.AdvancedHandler2.RaiseAfter(TArgs e) at CMS.Base.AdvancedHandler2.Finish() at CMS.DataEngine.AbstractInfoBase1.DeleteData() at CMS.DataEngine.AbstractInfoBase1.GeneralizedInfoWrapper.DeleteData() at CMS.DataEngine.AbstractInfoProvider3.DeleteInfo(TInfo info) at CMS.DocumentEngine.VersionAttachmentInfoProvider.DeleteVersionAttachmentInfoInternal(VersionAttachmentInfo attachmentObj) at CMS.DocumentEngine.AttachmentHistoryRemover.Remove() at CMS.DocumentEngine.AttachmentHistoryVersionRemover.b__0(AttachmentHistoryInfo history) at CMS.DataEngine.ObjectQueryBase2.<>c__DisplayClass2.b__0(TQuery q) at CMS.DataEngine.DataQueryBase1.ForEachPage(Action1 pageAction, Int32 pageSize) at CMS.DataEngine.ObjectQueryBase2.ForEachObject(Action1 objAction, Int32 batchSize) at CMS.DocumentEngine.AttachmentHistoryVersionRemover.Remove() at CMS.DocumentEngine.VersionManager.DestroyDocumentVersionInternal(Int32 versionHistoryId) at CMS.DocumentEngine.VersionManager.DestroyDocumentVersion(Int32 versionHistoryId) at System.Collections.Generic.List1.ForEach(Action1 action) at CMS.DocumentEngine.VersionManager.DeleteOlderVersionsInternal(Int32 documentId, String siteName) at CMS.DocumentEngine.VersionManager.CheckOutInternal(TreeNode node, Boolean nodeIsPublished, Boolean isAutomatic, Nullable`1 handleSpecialSteps) at CMS.DocumentEngine.VersionManager.CreateNewVersionInternal(TreeNode node) at CMS.FormEngine.Web.UI.CMSDocumentManager.CreateNewVersion()

Recent Answers


Juraj Ondrus answered on April 29, 2022 06:50

I would check the size of individual DB tables, especially those related to content/pages. Maybe the version history tables are too big and it takes long time to check all the page versions when creating new one. Check the number of records, size, etc. Maybe you should do some clean up and e.g. delete some oldest page versions.
Then, I would check the SQL profiler to see what SQL queries are causing the issue - this can tell you more what is going on.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.