Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception of type 'System.OutOfMemoryException' was thrown.

I got the following problem

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.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0    System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192    System.Reflection.Assembly.Load(String assemblyString) +35    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +123  [ConfigurationErrorsException: Exception of type 'System.OutOfMemoryException' was thrown.]    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11569328    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +485    System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +79    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +337    System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1167  [HttpException (0x80004005): Exception of type 'System.OutOfMemoryException' was thrown.]    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11702064    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4870277 

I didn't change the code ? what is this problem mean ,, as I see there is no more declaration about the error

like image 583
Adham Avatar asked Aug 26 '13 06:08

Adham


People also ask

How do you fix exception of type system OutOfMemoryException was thrown?

OutOfMemoryException' was thrown. To resolve this issue, I had to restart Visual Studio or go to the Windows Task Manager and terminate IIS Express process. This error could happen due to a variety of reasons related to memory consumption of the application.

What causes system OutOfMemoryException?

Conclusion. The OutOfMemoryException is a runtime exception that tells the programmer that there is no enough memory or there is a lack of contiguous memory for the allocations required by the C# program. To avoid this exception the user should always take necessary precautions and should handle this exception.

How can we avoid Outofmemory exception?

1) An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options "-Xmx512M", this will immediately solve your OutOfMemoryError.


1 Answers

This problem usually occurs when some process such as loading huge data to memory stream and your system memory is not capable of storing so much of data. Try clearing temp folder by giving the command

start -> run -> %temp%

like image 168
Nisha Avatar answered Sep 23 '22 05:09

Nisha