Asp.net mvc 3 MVC3内存不足异常

Asp.net mvc 3 MVC3内存不足异常,asp.net-mvc-3,telerik,Asp.net Mvc 3,Telerik,在部署了一个带有Telerik Extensions菜单的MVC3应用程序之后,我注意到它有时会抛出OutOfMemoryException,然后应用程序冻结,直到大约一个小时后,用户才能使用该应用程序 我设法从windows事件日志中跟踪错误,下面是从事件日志中提取的其中一个错误的堆栈跟踪 例外信息: Exception type: OutOfMemoryException Exception message: Exception of type 'System.OutOfMemoryExc

在部署了一个带有Telerik Extensions菜单的MVC3应用程序之后,我注意到它有时会抛出OutOfMemoryException,然后应用程序冻结,直到大约一个小时后,用户才能使用该应用程序

我设法从windows事件日志中跟踪错误,下面是从事件日志中提取的其中一个错误的堆栈跟踪

例外信息:

Exception type: OutOfMemoryException 
Exception message: Exception of type 'System.OutOfMemoryException' was thrown.
at System.RuntimeTypeHandle.ConstructName(RuntimeTypeHandle handle, 
Boolean nameSpace, Boolean fullInst, Boolean assembly, StringHandleOnStack retString)
at System.RuntimeType.RuntimeTypeCache.ConstructName(String& name, Boolean nameSpace, Boolean fullinst, Boolean assembly)
at System.RuntimeType.get_Name()
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.<GetAllControllerTypes>b__d(Type type)
at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
at Telerik.Web.Mvc.Extensions.CollectionExtensions.AddRange[T](ICollection`1 instance, IEnumerable`1 collection)
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.GetAllControllerTypes()
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.<GetControllerTypesWithinNamespaces>b__4()
at Telerik.Web.Mvc.Infrastructure.Implementation.Cache.Get[T](String key, Func`1 defaultValueFactory)
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.GetControllerTypesWithinNamespaces(String controllerName, IEnumerable`1 namespaces)
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.GetControllerTypes(String controllerName)
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerDescriptorCache.ControllerDescriptorFactory(String controllerName, String areaName)
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerDescriptorCache.<>c__DisplayClass1.<GetControllerDescriptor>b__0()
at Telerik.Web.Mvc.Infrastructure.Implementation.Cache.Get[T](String key, Func`1 defaultValueFactory)
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerDescriptorCache.GetControllerDescriptor(String controllerName, String areaName)
at Telerik.Web.Mvc.Infrastructure.Implementation.AuthorizationContextCache.AuthorizationContextFactory(RequestContext requestContext, String controllerName, String actionName, String areaName)
at Telerik.Web.Mvc.Infrastructure.Implementation.AuthorizationContextCache.<>c__DisplayClass1.<GetAuthorizationContext>b__0()
at Telerik.Web.Mvc.Infrastructure.Implementation.Cache.Get[T](String key, Func`1 defaultValueFactory)
at Telerik.Web.Mvc.Infrastructure.Implementation.AuthorizationContextCache.GetAuthorizationContext(RequestContext requestContext, String controllerName, String actionName, RouteValueDictionary routeValues)
at Telerik.Web.Mvc.Infrastructure.Implementation.ControllerAuthorization.IsAccessibleToUser(RequestContext requestContext, String controllerName, String actionName, RouteValueDictionary routeValues)
at Telerik.Web.Mvc.Infrastructure.Implementation.NavigationItemAuthorization.IsAccessibleToUser(RequestContext requestContext, INavigatable navigationItem)
at Telerik.Web.Mvc.UI.NavigatableExtensions.<>c__DisplayClass2`1.<IsAccessible>b__1(T item)
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at Telerik.Web.Mvc.UI.NavigatableExtensions.IsAccessible[T](IEnumerable`1 items, INavigationItemAuthorization authorization, ViewContext viewContext)
at Telerik.Web.Mvc.UI.NavigationItemContainerExtensions.WriteItem[TComponent,TItem](TItem item, TComponent component, IHtmlNode parentTag, INavigationComponentHtmlBuilder`1 builder)
at Telerik.Web.Mvc.UI.Menu.<>c__DisplayClass4.<WriteHtml>b__3(MenuItem item)
at Telerik.Web.Mvc.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 instance, Action`1 action)
at Telerik.Web.Mvc.UI.Menu.WriteHtml(HtmlTextWriter writer)
at Telerik.Web.Mvc.UI.ViewComponentBase.Render()
at Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.Render()
at ASP._Page_Views_Shared__Layout_cshtml.Execute() in e:\kidda\Views\Shared\_Layout.cshtml:line 34
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer)
at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
at System.Web.WebPages.WebPageBase.Write(HelperResult result)
at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
at System.Web.WebPages.WebPageBase.PopContext()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.<BeginProcessRequest>b__5()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.<EndProcessRequest>b__d()
at System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f)
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action)
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
异常类型:OutOfMemoryException
异常消息:引发了类型为“System.OutOfMemoryException”的异常。
在System.RuntimeTypeHandle.ConstructName(RuntimeTypeHandle,
布尔名称空间、布尔fullInst、布尔程序集、StringHandleOnStack(字符串)
位于System.RuntimeType.RuntimeTypeCache.ConstructName(字符串和名称、布尔名称空间、布尔fullinst、布尔程序集)
在System.RuntimeType.get_Name()处
在Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.b_ud(Type)
在System.Linq.Enumerable.WhererrayInterator`1.MoveNext()中
在Telerik.Web.Mvc.Extensions.CollectionExtensions.AddRange[T](ICollection`1实例,IEnumerable`1集合)
在Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.GetAllControllerTypes()上
在Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.b__4()上
在Telerik.Web.Mvc.Infrastructure.Implementation.Cache.Get[T](字符串键,Func`1 defaultValueFactory)
位于Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.GetControllerTypeSwithinnamespace(字符串controllerName,IEnumerable`1名称空间)
位于Telerik.Web.Mvc.Infrastructure.Implementation.ControllerTypeCache.GetControllerTypes(String controllerName)
位于Telerik.Web.Mvc.Infrastructure.Implementation.ControllerDescriptorCache.ControllerDescriptorFactory(字符串controllerName,字符串areaName)
在Telerik.Web.Mvc.Infrastructure.Implementation.ControllerDescriptorCache.c_udisplayClass1.b_u0()上
在Telerik.Web.Mvc.Infrastructure.Implementation.Cache.Get[T](字符串键,Func`1 defaultValueFactory)
位于Telerik.Web.Mvc.Infrastructure.Implementation.ControllerDescriptorCache.GetControllerDescriptor(字符串controllerName,字符串areaName)
位于Telerik.Web.Mvc.Infrastructure.Implementation.AuthorizationContextCache.AuthorizationContextFactory(RequestContext RequestContext,String controllerName,String actionName,String areaName)
在Telerik.Web.Mvc.Infrastructure.Implementation.AuthorizationContextCache.c_udisplayClass1.b_u0()上
在Telerik.Web.Mvc.Infrastructure.Implementation.Cache.Get[T](字符串键,Func`1 defaultValueFactory)
位于Telerik.Web.Mvc.Infrastructure.Implementation.AuthorizationContextCache.GetAuthorizationContext(请求上下文请求上下文、字符串控制器名、字符串操作名、RouteValueDictionary路由值)
位于Telerik.Web.Mvc.Infrastructure.Implementation.ControllerAuthorization.IsAccessibleToUser(RequestContext RequestContext,String controllerName,String actionName,RouteValueDictionary routeValues)
在Telerik.Web.Mvc.Infrastructure.Implementation.NavigationItemAuthorization.IsAccessibleToUser(RequestContext RequestContext,INavigatable navigationItem)
在Telerik.Web.Mvc.UI.NavigatableExtensions.c__;u DisplayClass2`1.b__;u 1(T项)
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source,Func`2谓词)
在Telerik.Web.Mvc.UI.NavigatableExtensions.IsAccessible[T](IEnumerable`1项,INavigationItemAuthorization授权,ViewContext)
在Telerik.Web.Mvc.UI.NavigationItemContainerExtensions.WriteItem[TComponent,TItem](TItem,TComponent component,IHtmlNode parentTag,INavigationComponentHtmlBuilder`1 builder)
在Telerik.Web.Mvc.UI.Menu.c__显示class4.b___3(菜单项)
在Telerik.Web.Mvc.Extensions.EnumerableExtensions.Each[T](IEnumerable`1实例,Action`1 Action)
在Telerik.Web.Mvc.UI.Menu.WriteHtml(HtmlTextWriter)上
在Telerik.Web.Mvc.UI.ViewComponentBase.Render()上
在Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.Render()上
在ASP.\u页面\u视图\u共享\u布局\u cshtml.Execute()中的e:\kidda\Views\Shared\\u Layout.cshtml:第34行
在System.Web.WebPages.WebPageBase.ExecutePageHierarchy()中
在System.Web.Mvc.WebViewPage.ExecutePageHierarchy()中
位于System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext、TextWriter writer、WebPageRenderingBase起始页)
在System.Web.WebPages.WebPageBase.c__DisplayClass7.b__6(文本编写器)中
位于System.Web.WebPages.HelperResult.WriteTo(文本编写器)
在System.Web.WebPages.WebPageBase.Write(HelperResult结果)中
位于System.Web.WebPages.WebPageBase.RendersUrounding(字符串partialViewName,操作`1 body)
在System.Web.WebPages.WebPageBase.PopContext()中
位于System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext、TextWriter writer、WebPageRenderingBase起始页)
位于System.Web.Mvc.RazorView.RenderView(ViewContext-ViewContext、TextWriter-writer、对象实例)
位于System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext、ViewContext、TextWriter)
在System.Web.Mvc.ViewResultBase.ExecuteSult(ControllerContext上下文)中
位于System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext ControllerContext,ActionResult ActionResult)
位于System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext ControllerContext,String actionName)
在System.Web.Mvc.Controller.ExecuteCore()上
在System.Web.Mvc.ControllerBase.Execute(RequestContext-RequestContext)中
位于System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext RequestContext)
在System.Web.Mvc.MvcHandler.c_uuudisplayClass6.c_uudisplayClassB.b_uu5()中
在System.Web.Mvc.Async.AsyncResultRapper.c__DisplayClass1.b__0()中
在System.Web.Mvc.Async.AsyncResultRapper.c_uuu显示类8`1.b_uuu7(IAsyncResult)
位于System.Web.Mvc.Async.AsyncResultRapper.WrappedAsyncResult`1.End()
在System.Web.Mvc.MvcHandler.c_udisplayClasse.b_ud()中
在System.Web.Mvc.SecurityUtil.b_0(操作f)
位于System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(操作)
位于System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncRes
<nav>
    <div id="topMenu" >
        <div style="width: 45%; float: right">
             @{ Html.Telerik().Menu()
                 .Name("Menu")
                 .Items(menu =>
                  {
                      menu.Add()
                        .Text("Ngaari")
                        .Items(item =>
                        {
                            item.Add().Text("List").Action("Index", "Ngaari");
                            item.Add().Text("Statement").Action("Index", "Statement");
                        });
                      menu.Add()
                        .Text("Njia")
                        .Action("Index", "Njia");
                      menu.Add()
                        .Text("Kiama")
                        .Action("Index", "Kiama");
                      menu.Add()
                        .Text("Ngaari Type")
                        .Action("Index", "NgaariType");
                      menu.Add()
                        .Text("Admin")
                        .Items(item =>
                        {
                            item.Add().Text("List Users").Action("Index", "Account");
                            item.Add().Text("Add User").Action("NewUser", "Account");
                            item.Add().Text("Change Password").Action("ChangePassword", "Account");
                        });
                })
                .Render();
              }
        </div>
    </div>
</nav>