2

I've taken over an Entity Framework 4.1 project where a choice has been made to store large BLOB's in the database (max 200MB). These blobs are loaded in-memory via LINQ to Entities. Of course, this has a rather negative impact on performance...

It also gives me a nice opportunity to look at EF memory consumption and now I see that when I read an object containing a 50MB blob, memory increases by 150MB. I know there's a 'current values' and 'original values' collection, but what there is obviously a third copy. What is this?

4

1 回答 1

1

默认情况下,上下文应保留原始值和当前值的副本。

对于只读用途,您应该能够通过禁用更改跟踪将内存占用减少 50M。

第三个副本可能是 blob 的一些非托管副本,但请通过 procdump 确定。

于 2013-10-02T09:08:40.777 回答