+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Exception of type 'System.OutOfMemoryException' was thrown

Exception of type 'System.OutOfMemoryException' was thrown

4 posts, 1 answered
  1. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    20 Jan 2012
    Link to this post
    There's another thread that talks about this problem, but it seems to have run dead so I'd like to bring this up again.

    This morning we were working on our Sitefinity site, on the master pages in particular. We were struggling to disable the CSS files rendered out by the Telerik controls, but we eventually figured it out.
    Then we moved our theme files into the new folder structure under App_data as suggested by Telerik. We followed the instructions to configure the new theme under the administration section, created a new template and applied the new theme to the template.

    Everything worked well, but then suddenly the application started crashing. We monitored the server memory and noticed a serious problem with the worker process memory consumption. From the rate at which it swallows up memory (up to 2Gb within 5-10 seconds) it would seem like some kind of infinite loop. What doesn't make sense though is why?

    The Sitefinity and Windows event log list the following:
    ----------------------------------------
    Timestamp: 1/20/2012 11:13:36 AM
     
    Message: HandlingInstanceID: a67013be-427c-41a3-ba8e-638010c08247
    An exception of type 'System.OutOfMemoryException' occurred and was caught.
    ---------------------------------------------------------------------------
    01/20/2012 13:13:36
    Type : System.OutOfMemoryException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Message : Exception of type 'System.OutOfMemoryException' was thrown.
    Source : mscorlib
    Help link :
    Data : System.Collections.ListDictionaryInternal
    TargetSite : Void set_Capacity(Int32)
    Stack Trace :    at System.Collections.Generic.List`1.set_Capacity(Int32 value)
       at System.Collections.Generic.List`1.Add(T item)
       at Telerik.Sitefinity.Modules.Pages.PageHelper.GetTemplates(PageNode pageNode)
       at Telerik.Sitefinity.Web.PageSiteNode.LoadPageData()
       at Telerik.Sitefinity.Web.PageSiteNode.get_Visible()
       at Telerik.Sitefinity.Web.RouteHelper.CheckSiteMapNode(SiteMapNode pageSiteMapNode)
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.FilterNodes(SiteMapNodeCollection nodes, Boolean modifyCollection)
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.Helper.FilterChildNodes(SiteMapNode node, SitefinitySiteMapDataSource dataSource)
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.InnerPageSiteNode.get_ChildNodes()
       at Telerik.Sitefinity.Web.RouteHelper.CheckGroupSiteMapNode(PageSiteNode node)
       at Telerik.Sitefinity.Web.RouteHelper.CheckSiteMapNode(SiteMapNode pageSiteMapNode)
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.FilterNodes(SiteMapNodeCollection nodes, Boolean modifyCollection)
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.Helper.FilterChildNodes(SiteMapNode node, SitefinitySiteMapDataSource dataSource)
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.InnerPageSiteNode.get_ChildNodes()
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.GetNodes(SiteMapNode node)
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.GetPathNodeCollection(String viewPath)
       at Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.GetView(String viewName)
       at System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView()
       at System.Web.UI.WebControls.DataBoundControl.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.AddedControl(Control control, Int32 index)
       at System.Web.UI.Control.EnsureChildControls()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     
    Additional Info:
     
    MachineName : MyMachine
    TimeStamp : 1/20/2012 11:13:36 AM
    FullName : Telerik.Sitefinity.Utilities, Version=4.3.1885.0, Culture=neutral, PublicKeyToken=b28c218413bdf563
    AppDomainName : /LM/W3SVC/17/ROOT-1-129715315386278148
    ThreadIdentity : Anonymous
    WindowsIdentity : NT AUTHORITY\NETWORK SERVICE
     
     
    Category: ErrorLog
    Priority: 0
    EventId: 90000
    Severity: Error
    Title:Enterprise Library Exception Handling
    Machine: YODA
    App Domain: /LM/W3SVC/17/ROOT-1-129715315386278148
    ProcessId: 8940
    Process Name: c:\windows\system32\inetsrv\w3wp.exe
    Thread Name:
    Win32 ThreadId:7756
    Extended Properties:
    ----------------------------------------

    We've restarted the Windows 2008 server, which didn't help.

    Right now, the application is broken, we can do nothing about it. Everything we've tried has failed. Not sure what else to do.

    Anyone find a solution for this yet?

    Jacques
  2. Elsane
    Elsane avatar
    30 posts
    Registered:
    06 Jan 2012
    20 Jan 2012
    Link to this post
    Hello,

    It seems that we have the same kind of error than you !

    [OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
       System.Collections.Generic.List`1.set_Capacity(Int32 value) +62
       System.Collections.Generic.List`1.EnsureCapacity(Int32 min) +34
       System.Collections.Generic.List`1.Add(T item) +54
       Telerik.Sitefinity.Modules.Pages.PageHelperImplementation.GetTemplates(PageNode pageNode) +66
       Telerik.Sitefinity.Web.PageSiteNode.LoadPageData() +579
       Telerik.Sitefinity.Web.PageSiteNode.get_Visible() +9
       Telerik.Sitefinity.Web.UI.NavigationControls.InnerPageSiteNode.get_Visible() +18
       Telerik.Sitefinity.Web.RouteHelper.CheckSiteMapNode(SiteMapNode pageSiteMapNode) +298
       Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.CheckNode(SiteMapNode node) +68
       Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.FilterNodes(SiteMapNodeCollection nodes, Boolean modifyCollection) +373
       Telerik.Sitefinity.Web.UI.NavigationControls.Helper.FilterChildNodes(SiteMapNode node, SitefinitySiteMapDataSource dataSource) +325
       Telerik.Sitefinity.Web.UI.NavigationControls.InnerPageSiteNode.get_ChildNodes() +29
       Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.GetNodes(SiteMapNode node) +68
       Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.GetNodes() +352
       Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.GetPathNodeCollection(String viewPath) +46
       Telerik.Sitefinity.Web.UI.NavigationControls.SitefinitySiteMapDataSource.GetView(String viewName) +40
       System.Web.UI.WebControls.SiteMapDataSource.System.Web.UI.IDataSource.GetView(String viewName) +10
       System.Web.UI.WebControls.ReadOnlyDataSource.System.Web.UI.IDataSource.GetView(String viewName) +8809165
       System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +266
       System.Web.UI.WebControls.DataBoundControl.OnLoad(EventArgs e) +19
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +9041218
       System.Web.UI.ControlCollection.Add(Control child) +79
       Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +96
       System.Web.UI.Control.EnsureChildControls() +102
       System.Web.UI.Control.PreRenderRecursiveInternal() +42
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

    Have you made any changes in your templates especially the navigation menu ?

    If we go to the backoffice, the navigation widget can"t find top level page... It appear empty even if we delete and recreate it.. When we launch our page we get this OutOfMemory error...

    We have sitefinity 4.4

  3. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    22 Sep 2016
    21 Jan 2012
    Link to this post
    Hi,

    The problem is usually caused by several things. The most possible one is because there is a page template using a master page based on itself. Can you review Design->Page Templates and check the column base on template and see if a template using a master page is based on itself. For example a template is using Page.master to create a template called MyTemplate and MyTemplate is based on a template called MyTemplate. This is causing a loop because MyTempalte is searching for MyTemplate which is also searching for MyTemplate and so on and this fills up all the server memory and the error is thrown. 

    Another cause is if you are using a custom navigation widget on some of the pages and in the code behind of the control IsNodeAccessible property is used. This is not working properly in Sitefinity 4.2 and above so it is best to remove it. It is also causing a loop.
    Another cause is if using a widget that for example queries an image,document or video library and displays results on the frontend. Sitefinity API used for taking media content might be wrong and getting all images in the library and then fitering them to show only a few (App.WorkWith().Images().Get().ToList and then filter with .Where() ). 

    If the system is eating so much memory there is a memory leak most likely caused by some of the mentioned issues.
    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  4. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    21 Jan 2012
    Link to this post
    Hi Stanislav,

    The duplicate template seems to have been the problem. It never occurred to me that even though the front end was bombing out within a few seconds that the back end would still work, but it did.

    Thanks for the help.

    Jacques
4 posts, 1 answered