programing

'시스템' 유형의 예외입니다.메모리 부족'예외'가 던져졌습니다.

jooyons 2023. 5. 25. 21:57
반응형

'시스템' 유형의 예외입니다.메모리 부족'예외'가 던져졌습니다.

다음과 같은 문제가 발생했습니다.

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

코드를 변경하지 않았습니다. 오류에 대한 선언이 더 이상 없습니다. 이 문제는 무엇을 의미합니까?

이 문제는 일반적으로 대용량 데이터를 메모리 스트림에 로드하는 것과 같은 일부 프로세스에서 시스템 메모리가 많은 데이터를 저장할 수 없는 경우에 발생합니다.명령을 사용하여 임시 폴더를 지우십시오.

시작 -> 실행 -> %tg%

또 다른 시도는

도구 -> 옵션 -> IIS 검색 -> 웹 사이트 및 프로젝트에 64비트 버전의 IIS Express 사용을 선택합니다.

웹 사이트 및 프로젝트 스크린샷에 64비트 버전의 IIS Express 사용

디버그 모드에서 실행 중

응용 프로그램을 개발하고 디버깅할 때 일반적으로 web.config 파일의 debug 속성을 true로 설정하고 DLL을 디버그 모드로 컴파일하여 실행합니다.그러나 테스트 또는 프로덕션에 응용 프로그램을 배포하기 전에 구성 요소를 릴리스 모드로 컴파일하고 디버그 특성을 false로 설정해야 합니다.

ASP.NET은 디버그 모드에서 실행할 때 여러 수준에서 다르게 작동합니다.실제로 디버그 모드에서 실행 중인 경우 GC는 개체가 더 오래 활성 상태를 유지하도록 허용하므로 디버그 모드에서 실행될 때 항상 더 높은 메모리 사용량을 확인할 수 있습니다.

디버그 모드에서 실행할 때 종종 실현되지 않는 또 다른 부작용은 클라이언트 스크립트가 웹 리소스를 통해 제공된다는 것입니다.axd 및 스크립트 리소스.axd 핸들러는 캐시되지 않습니다.즉, 각 클라이언트 요청은 클라이언트 측 캐싱을 활용하는 대신 스크립트(예: ASP.NET AJAX 스크립트)를 다운로드해야 합니다.이는 상당한 성능 저하로 이어질 수 있습니다.

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

방금 Visual Studio를 다시 시작하고 IISRESET을 실행하여 문제를 해결했습니다.

IIS Express를 사용하는 경우Show All Application작업 표시줄 알림 영역의 IIS Express에서 다음을 선택합니다.Stop All.

이제 응용프로그램을 다시 실행합니다.

언급URL : https://stackoverflow.com/questions/18438281/exception-of-type-system-outofmemoryexception-was-thrown

반응형