Nop.Web.exe - System.OutOfMemoryException

2 years ago
I upgrade from Nop3.8 to nop4.0 and I can't go in production because I receive this message after 400-500 page load :

Server use 3GB of 16GB Total
All my memory config in the AppPool is set to 0 (No limit)
Site info :
~30 000 product
~9000 customer

Log Name:      Application
Source:        .NET Runtime
Date:          2/1/2018 4:17:32 PM
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      PNQ-WEB
Description:
Application: Nop.Web.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException
   at System.Data.Entity.Core.Objects.ObjectStateManager.PerformAdd(System.Collections.Generic.IList`1<System.Data.Entity.Core.Objects.EntityEntry>)
   at System.Data.Entity.Core.Objects.ObjectStateManager.DetectChanges()
   at System.Data.Entity.Core.Objects.ObjectContext.DetectChanges()
   at System.Data.Entity.Internal.InternalContext.DetectChanges(Boolean)
   at System.Data.Entity.Internal.InternalContext.GetStateEntries(System.Func`2<System.Data.Entity.Core.Objects.ObjectStateEntry,Boolean>)
   at System.Data.Entity.Internal.InternalContext.GetStateEntries()
   at System.Data.Entity.Infrastructure.DbChangeTracker.Entries()
   at System.Data.Entity.DbContext.GetValidationErrors()
   at System.Data.Entity.Internal.InternalContext.SaveChanges()
   at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
   at System.Data.Entity.DbContext.SaveChanges()
   at Nop.Data.EfRepository`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon)
   at Nop.Services.Logging.DefaultLogger.InsertLog(Nop.Core.Domain.Logging.LogLevel, System.String, System.String, Nop.Core.Domain.Customers.Customer)
   at Nop.Services.Logging.LoggingExtensions.FilteredLog(Nop.Services.Logging.ILogger, Nop.Core.Domain.Logging.LogLevel, System.String, System.Exception, Nop.Core.Domain.Customers.Customer)
   at Nop.Services.Tasks.TaskThread.Run()
   at Nop.Services.Tasks.TaskThread.TimerHandler(System.Object)
   at System.Threading.TimerQueueTimer.CallCallbackInContext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.AppDomainTimerCallback()


Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1026</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2018-02-01T21:17:32.000000000Z" />
    <EventRecordID>81968</EventRecordID>
    <Channel>Application</Channel>
    <Computer>PNQ-WEB</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Application: Nop.Web.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException
   at System.Data.Entity.Core.Objects.ObjectStateManager.PerformAdd(System.Collections.Generic.IList`1&lt;System.Data.Entity.Core.Objects.EntityEntry&gt;)
   at System.Data.Entity.Core.Objects.ObjectStateManager.DetectChanges()
   at System.Data.Entity.Core.Objects.ObjectContext.DetectChanges()
   at System.Data.Entity.Internal.InternalContext.DetectChanges(Boolean)
   at System.Data.Entity.Internal.InternalContext.GetStateEntries(System.Func`2&lt;System.Data.Entity.Core.Objects.ObjectStateEntry,Boolean&gt;)
   at System.Data.Entity.Internal.InternalContext.GetStateEntries()
   at System.Data.Entity.Infrastructure.DbChangeTracker.Entries()
   at System.Data.Entity.DbContext.GetValidationErrors()
   at System.Data.Entity.Internal.InternalContext.SaveChanges()
   at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
   at System.Data.Entity.DbContext.SaveChanges()
   at Nop.Data.EfRepository`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon)
   at Nop.Services.Logging.DefaultLogger.InsertLog(Nop.Core.Domain.Logging.LogLevel, System.String, System.String, Nop.Core.Domain.Customers.Customer)
   at Nop.Services.Logging.LoggingExtensions.FilteredLog(Nop.Services.Logging.ILogger, Nop.Core.Domain.Logging.LogLevel, System.String, System.Exception, Nop.Core.Domain.Customers.Customer)
   at Nop.Services.Tasks.TaskThread.Run()
   at Nop.Services.Tasks.TaskThread.TimerHandler(System.Object)
   at System.Threading.TimerQueueTimer.CallCallbackInContext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.AppDomainTimerCallback()

</Data>
  </EventData>
</Event>

Thanks
1 year ago
Build Nop.Web as x64 and there you are