More in this section

Forums / Developing with Sitefinity / NewsView OutOfMemory Exception

NewsView OutOfMemory Exception

2 posts, 0 answered
  1. Jay
    Jay avatar
    25 posts
    Registered:
    12 May 2008
    24 Nov 2008
    Link to this post
    Hi,

    On Friday we released sitefinity to our production environment, unfortunately after about an hour the site went down with the following error.

    The following information is part of the event: System.Runtime.InteropServices.ExternalException: Cannot execute a program. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /noconfig /fullpaths @"C:\WINDOWS\TEMP\nujoop2n.cmdline".

       at System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)

       at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)

       at Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs)

       at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)

       at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)

       at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)

       at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources)

       at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)

       at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)

       at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)

       at System.Xml.Serialization.XmlSerializer..ctor(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace, String location, Evidence evidence)

       at System.Xml.Serialization.XmlSerializer..ctor(Type type, Type[] extraTypes)

       at Telerik.Cms.Engine.WebControls.ContentView.DeserializeDesignerSettings(String settingsCollection)

       at Telerik.Cms.Engine.WebControls.ContentView.ApplyModeMasterSettings(Control container)

       at Telerik.Cms.Engine.WebControls.ContentView.repeater_ItemDataBound(Object sender, RepeaterItemEventArgs e)

       at System.Web.UI.WebControls.RepeaterItemEventHandler.Invoke(Object sender, RepeaterItemEventArgs e)

       at System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e)

       at System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem)

       at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)

       at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)

       at System.Web.UI.WebControls.Repeater.DataBind()

       at Telerik.Cms.Engine.WebControls.ContentView.CreateChildControls()

       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).


    Googling the problem it seemed to be associated with a memory leak and once the app pool refreshed the site came back to life.

    We were able to replicate the same problem in our dev environment by hitting our sitefinity homepage with Jmeter (a load tool),  we observed the worker process was not releasing memory and once it hit 1,000,000k our dev site then fall over and produced the same error as production.

    We then set about removing our user controls from the homepage one by one while observing the memory usage, as soon as we removed the NewsView control the memory usage leveled out.

    Our NewsView control was using a custom control template which was set via the exposed property ItemListTemplatePath in the advanced tab, our next step was to remove everything from our custom control template one line at a time until all we were left with was a repeater declaration but we were still seeing the worker process not release memory.

    If we then switch back to Sitefinitys default template everything seems to work fine.

    We are using sitefinity 3.2 sp1 IIS6  on windows server 2003

    We could set the app pool to recycle once a certain memory limit is hit, but this would just mask the problem, obviously this is affecting us releasing to production, any help you could give is appreciated.

    Kind Regards,

    Jay Macilquham
  2. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    25 Nov 2008
    Link to this post
    Hi Jay,

    Probably, the described problem is related to a memory leak issue which we have in version 3.2 with our SettingsListConverter class:

    The problem is fixed for our last release (v3.5 SP1). So we would strongly recommend your upgrade your project to the latest Sitefinity version.

    Actually, the root of the problem comes from a memory leak in the .NET XmlSerializer class.
    For additional information on this matter, visit the following links:
    .NET Memory Leak: XmlSerializing your way to a Memory Leak
    http://support.microsoft.com/kb/886385/en-us

    Best wishes,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered