Description
Description
Out of Memory saving many entities via BulkSaveChanges
Exception
The application container is being terminated due to memory issues when performing BulkSaveChanges.
Exception message:
Stack trace:
I moved over to EF plus because I thought BulkSaveChanges would solve my EF save issues.
However, I'm beginning to think the issue isn't the amount of data needing to be saved, rather, the change detection needed to figure out which data needs to be saved.
I've made sure all of my entities have the proper Entity.State on them prior to disabling _context.ChangeTracker.AutoDetectChanges and calling BulkSaveChanges with a batch size of 500. However, even with change detection disabled, I get a few hundered log entries of "BulkSave Message: "-- Completed at 08/16/2024 07:18:40 PM -- Result: 1 tables " or similar, before it finally runs out of memory and crashes.
Is there some fundamental I'm missing here? I'm not exactly sure why I would be starving for memory during save changes.
Further technical details
- EF version: [EF Core v8.0.4]
- EF Extensions version: [EFE Core v8.103.0.0]
- Database Server version: [AWS Aurora MySql Server 8.0]