2011-06-19 82 views
1

私はこの例外をプロジェクトの途中で実行します.F5を押してデバッグを開始します。 Visual Studio 2011を使用しています。プロジェクトはMCV3、EF4で、プロジェクトでCrystalレポートを使用しています。ここでタイプ 'System.OutOfMemoryException'の例外がスローされました

は、例外のトレースです:

Server Error in '/' Application.

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.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144 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) +618 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94 System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +591

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

これが出てくる方法上の任意のアイデア。

+0

例外は、アセンブリをロードするコードのCLR内のコードによってスローされます。それはスタックトレースから推測できるすべてです。より多くを表示するには、アンマネージデバッガが必要です。 –

答えて

1

ます(多分)どこかにあなたのコードで再帰呼び出しを持っている、すなわち

クラス CTOR(){ CallAMethod(); } CallAMethod() { A a = new A(); } }

EDIT:パウリは当然再帰は通常、しかし、StackOverflowExceptionがの原因となる(そして間違ったなら、私を修正)することを指摘し、私は、オブジェクトが大きくなければならない、いくつかの8万呼び出しの再帰とシステム限定の上限を見てきました(他の読書から、私はこれもプレーになる可能性があると思うが、リニアアドレス空間ではなくCLRヒープサイズであることが分かる)、リソースがなくなるだろう。

+0

私はテスト環境にプロジェクトを公開しようとしたときにこの問題を抱えています。 – tkt986

+0

スタックトレースは、オーバーフローの場合に役立ちません(無限再帰はあらゆる種類の誤検出を引き起こす可能性があります)。コードをチェックしてください。これは、ほとんどの場合、あなたやライブラリの再帰を作成しているために発生します。 –

+2

無限再帰はStackOverflowExceptionにつながります –

関連する問題