While preparing large amount (several thousand rows) of data and insert them to database through Entity Framework, creating the Entity objects or the in-memory object-graphs doesn’t take up that much memory, but when the SaveChanges() method is called, over the duration it continues to consume noticeable amount of memory until the method returns.
What exactly happens under-the-hood during the period of the SaveChanges() call that causes this memory consumption?