What tier machine do you host the app on in Azure? Check the memory limit there, and then start the app and monitor the memory usage in the "Metrics" blade in Azure portal. See if it reaches your machine's memory limit. If so you might want to scale up to increase memory.
Note that it can of course also be because of how the app is written, maybe it's eating way to much memory too fast.
System.OutOfMemoryException: Exception
Hi, I've been having a lot of System.OutOfMemoryException error in a Umbraco site running on Azure.
Error details:
{"@t":"2022-06-23T23:59:47.8884127Z","@mt":"An unhandled exception has occurred while executing the request.","@l":"Error","@x":"System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.\r\n at System.SZArrayHelper.GetEnumeratorT\r\n at System.Linq.Enumerable.Any[TSource](IEnumerable
1 source, Func
2 predicate)\r\n at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEPropertySymbol.<.ctor>ganyUnexpectedRequiredModifiers|170(ParamInfo1[] propertyParams)\r\n at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEPropertySymbol..ctor(PEModuleSymbol moduleSymbol, PENamedTypeSymbol containingType, PropertyDefinitionHandle handle, PEMethodSymbol getMethod, PEMethodSymbol setMethod, ParamInfo
1[] propertyParams, MetadataDecoder metadataDecoder)\r\n at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEPropertySymbol.Create(PEModuleSymbol moduleSymbol, PENamedTypeSymbol containingType, PropertyDefinitionHandle handle, PEMethodSymbol getMethod, PEMethodSymbol setMethod)\r\n at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENamedTypeSymbol.CreateProperties(Dictionary2 methodHandleToSymbol, ArrayBuilder
1 members)\r\n at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENamedTypeSymbol.LoadMembers()\r\n at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENamedTypeSymbol.EnsureAllMembersAreLoaded()\r\n at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENamedTypeSymbol.GetMembers(String name)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.GetCandidateMembers(NamespaceOrTypeSymbol nsOrType, String name, LookupOptions options, Binder originalBinder)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.LookupMembersInClass(LookupResult result, TypeSymbol type, String name, Int32 arity, ConsList1 basesBeingResolved, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType, Boolean diagnose, CompoundUseSiteInfo
1& useSiteInfo)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.LookupMembersInClass(LookupResult result, TypeSymbol type, String name, Int32 arity, ConsList1 basesBeingResolved, LookupOptions options, Binder originalBinder, Boolean diagnose, CompoundUseSiteInfo
1& useSiteInfo)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.LookupMembersInType(LookupResult result, TypeSymbol type, String name, Int32 arity, ConsList1 basesBeingResolved, LookupOptions options, Binder originalBinder, Boolean diagnose, CompoundUseSiteInfo
1& useSiteInfo)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.LookupMembersInternal(LookupResult result, NamespaceOrTypeSymbol nsOrType, String name, Int32 arity, ConsList1 basesBeingResolved, LookupOptions options, Binder originalBinder, Boolean diagnose, CompoundUseSiteInfo
1& useSiteInfo)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.LookupMembersWithFallback(LookupResult result, NamespaceOrTypeSymbol nsOrType, String name, Int32 arity, CompoundUseSiteInfo1& useSiteInfo, ConsList
1 basesBeingResolved, LookupOptions options)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindInstanceMemberAccess(SyntaxNode node, SyntaxNode right, BoundExpression boundLeft, String rightName, Int32 rightArity, SeparatedSyntaxList1 typeArgumentsSyntax, ImmutableArray
1 typeArgumentsWithAnnotations, Boolean invoked, Boolean indexed, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindMemberAccessWithBoundLeft(ExpressionSyntax node, BoundExpression boundLeft, SimpleNameSyntax right, SyntaxToken operatorToken, Boolean invoked, Boolean indexed, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindMemberAccess(MemberAccessExpressionSyntax node, Boolean invoked, Boolean indexed, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindMethodGroup(ExpressionSyntax node, Boolean invoked, Boolean indexed, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindInvocationExpression(InvocationExpressionSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionInternal(ExpressionSyntax node, BindingDiagnosticBag diagnostics, Boolean invoked, Boolean indexed)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindExpression(ExpressionSyntax node, BindingDiagnosticBag diagnostics, Boolean invoked, Boolean indexed)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindValue(ExpressionSyntax node, BindingDiagnosticBag diagnostics, BindValueKind valueKind)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindInferredVariableInitializer(BindingDiagnosticBag diagnostics, ExpressionSyntax initializer, BindValueKind valueKind, RefKind refKind, CSharpSyntaxNode errorSyntax)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindVariableDeclaration(SourceLocalSymbol localSymbol, LocalDeclarationKind kind, Boolean isVar, VariableDeclaratorSyntax declarator, TypeSyntax typeSyntax, TypeWithAnnotations declTypeOpt, AliasSymbol aliasOpt, BindingDiagnosticBag diagnostics, Boolean includeBoundType, CSharpSyntaxNode associatedSyntaxNode)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindDeclarationStatementParts(LocalDeclarationStatementSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindLocalDeclarationStatement(LocalDeclarationStatementSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindBlockParts(BlockSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindBlock(BlockSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindPossibleEmbeddedStatement(StatementSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindIfStatement(IfStatementSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindBlockParts(BlockSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindBlock(BlockSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindMethodBody(CSharpSyntaxNode declaration, BlockSyntax blockBody, ArrowExpressionClauseSyntax expressionBody, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.Binder.BindMethodBody(CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics)\r\n at Microsoft.CodeAnalysis.CSharp.MethodCompiler.BindMethodBody(MethodSymbol method, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, VariableState nullableInitialState, ImportChain& importChain, Boolean& originalBodyNested, InitialState& forSemanticModel)\r\n at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethod(MethodSymbol methodSymbol, Int32 methodOrdinal, ProcessedFieldInitializers& processedInitializers, SynthesizedSubmissionFields previousSubmissionFields, TypeCompilationState compilationState)\r\n at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileNamedType(NamedTypeSymbol containingType)\r\n at Microsoft.CodeAnalysis.CSharp.MethodCompiler.<>cDisplayClass230.The error is solved by restarting the app service, what could be the cause?
Hi!
Are you running the app in debug mode?
What tier machine do you host the app on in Azure? Check the memory limit there, and then start the app and monitor the memory usage in the "Metrics" blade in Azure portal. See if it reaches your machine's memory limit. If so you might want to scale up to increase memory.
Note that it can of course also be because of how the app is written, maybe it's eating way to much memory too fast.
Me too same problem, I am also looking for a solution.
is working on a reply...