locked
Free space on IIS Web server and Out of memory exception RRS feed

  • Question

  • User205214896 posted

    Hi

    I am working on an ASP.NET 2.0 application. It is hosted on Windows 2003 server with IIS 6.0.  Sometimes I get the following error when i generate

    big reports in my application.

    Server Error: 

    Exception of type 'System.OutOfMemoryException' was thrown.
    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. 

    Stack Trace:


    [OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
       System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
       System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
       System.Reflection.Assembly.Load(String assemblyString) +28
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

    [ConfigurationErrorsException: Exception of type 'System.OutOfMemoryException' was thrown.]
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
       System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
       System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +227
       System.Web.Compilation.BuildManager.CompileGlobalAsax() +52
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337

    [HttpException (0x80004005): Exception of type 'System.OutOfMemoryException' was thrown.]
       System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729

    [HttpException (0x80004005): Exception of type 'System.OutOfMemoryException' was thrown.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
       System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259

    How to solve this error?

    Also the session gets expired though i have set the time out as 60 in the web config file.  

    <sessionState mode="InProc"  timeout="60"/>

    I monitored the CPU usage on the web server while generating the reports. It reaches 100% for and few seconds while the reports are generated and becomes less after that. 

    Web server has very less free space(2 GB) and what is the amount of free space required on the server?

    Will the Web server kill the session if there is no enough memory?

     

    Thanks

    Ashok

    Tuesday, April 20, 2010 8:27 PM

Answers

  • User-1853252149 posted

    what is the amount of free space required on the server?

    Memory isn't drive space.  It's the available RAM, real and virtual, available.  You can increase virtual RAM (See a good Windows server reference for information on how) but you may need to look at adding RAM to the box.

    Jeff

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Wednesday, April 21, 2010 3:12 PM