Exception of type 'System.OutOfMemoryException' was thrown
Hi, at this moment i'm experiencing memory problems, below is the stack trace of this issue. Our server is using 4gb of memory. I can log in, access dashboard and get into Pages or Page Templates, but when I hit to a page or template, it takes too long and throw me the bellow message.
Thanks for help!
Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code.
Exception Details:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException'
was thrown.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
[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.PageHelper.GetTemplates(PageNode pageNode) +64 Telerik.Sitefinity.Web.PageSiteNode.LoadPageData() +762 Telerik.Sitefinity.Web.SiteMapBase.FindSiteMapNodeForSpecificLanguage(SiteMapNode node, CultureInfo cultureInfo) +92 Telerik.Sitefinity.Web.SitefinityRoute.GetRouteData(HttpContextBase httpContext) +316 System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +287 System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +60 System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +86 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 |
Hello Ivan,
From the look of the stack trace seems that a template is causing an internal loop which fills the memory of the server thus throwing an exception.
Please check if you have any layout controls that might be causing the issue or if you have applied other changes to the masterpage that you use for your pages.
Greetings,
Victor Velev
the Telerik team
Hi Ivan,
That's too vague a statement to make: "a template is causing an internal loop". How does a template suddenly cause an internal loop?
We're experiencing the problem right now where 5 minutes ago the site worked fine, but now it's falling over constantly with this exception.
When looking at the server memory we can see how the memory is quadrupling with in a matter of seconds. This is a page and template that worked not 5 minutes ago. How is it possible that this can suddenly happen with no changes having been made to it?
Hello Jacques,
I see that you are communicating with a colleague of mine regarding the issue. If possible Ivan can share with us what was the cause for the problem, so you can verify whether the case is the same with you.
All the best,
Victor Velev
the Telerik team
Hi Victor,
It would seem that the cause was a template in an infinite loop.
Would it not make sense then to have a check in Sitefinity to make sure the administrator is not aloud to create a template based on itself?
Regards,
Jacques
Hi Jacques,
There was a bug related to such scenario, which was later fixed. Can you tell us which version of Sitefinity you have used to replicate the issue?
All the best,
Victor Velev
the Telerik team
Hi Victor,
The version is SF 4.3
Regards,
Jacques
Issue resolved! the problem was we was installing a template using itself, it was recycling and that's why the memory thrown down.
Hi all,
@Jackques: the error should not be present in the version you speak of, however if your project has been upgraded from a previous version of Sitefinity, you may experience the issue.
All the best,
Victor Velev
the Telerik team
So does that mean there's a bug in the upgrade mechanism?
Hi Jacques,
This hardly can be considered as a bug, as in 4.2+ we have made some changes which will detect such issues and throw the OutofMemoryException. If you have a template that is based on another template - it is completely ok, but if the initial template is based on the newer template all pages associated with the second one will throw the error, because of the internal loop that will be caused.
All the best,
Victor Velev
the Telerik team