Uitzondering van het type ‘System.OutOfMemoryException’ is opgetreden.

Ik heb het volgende probleem

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

Ik heb de code niet gewijzigd? wat betekent dit probleem, zoals ik zie is er geen verklaring meer over de fout


Antwoord 1, autoriteit 100%

Dit probleem treedt meestal op wanneer een proces, zoals het laden van enorme gegevens naar de geheugenstroom, en uw systeemgeheugen niet in staat is zoveel gegevens op te slaan. Probeer de tijdelijke map te wissen door het commando

. te geven

start -> uitvoeren -> %temp%


Antwoord 2, autoriteit 46%

Een ander ding om te proberen is

Extra -> Opties -> zoek naar IIS-> vink Gebruik de 64-bits versie van IIS Express voor websites en projecten.


Antwoord 3, autoriteit 40%

Werkt in de foutopsporingsmodus

Wanneer u een toepassing ontwikkelt en debugt, voert u doorgaans het debug-kenmerk in het web.config-bestand in op true en worden uw DLL’s in debug-modus gecompileerd. Voordat u uw toepassing echter implementeert om te testen of voor productie, moet u uw componenten compileren in de release-modus en het debug-kenmerk instellen op false.

ASP.NET werkt op veel niveaus anders wanneer het in de foutopsporingsmodus wordt uitgevoerd. Als u in de foutopsporingsmodus werkt, zorgt de GC ervoor dat uw objecten langer in leven blijven (tot het einde van het bereik), zodat u altijd een hoger geheugengebruik zult zien wanneer u in de foutopsporingsmodus draait.

Een ander vaak niet-gerealiseerd neveneffect van het draaien in debug-modus is dat clientscripts die worden aangeboden via de webresource.axd- en scriptresource.axd-handlers niet in de cache worden opgeslagen. Dat betekent dat elk clientverzoek alle scripts moet downloaden (zoals ASP.NET AJAX-scripts) in plaats van te profiteren van client-side caching. Dit kan leiden tot een aanzienlijke prestatiehit.

Bron: http://blogs.iis.net/webtopics/archive/2009/05/22/troubleshooting-system-outofmemoryexceptions-in-asp-net.aspx


Antwoord 4, autoriteit 17%

Als u IIS Express gebruikt, selecteert u Show All Applicationvan IIS Express in het systeemvak van de taakbalk en selecteert u vervolgens Stop All.

Voer nu uw applicatie opnieuw uit.


Antwoord 5, autoriteit 17%

Ik heb Visual Studio zojuist opnieuw opgestart en IISRESET uitgevoerd, waardoor het probleem is opgelost.

Other episodes