Reputation: 12253
I am running into some problems where huge objects occupy memory and the reference is not being released. I used .Net Memory Profiler to find out the root object and it references to Entity Framework class.
Is there a way i can disable the caching of queried objects in Entity framework without chanign the code? Something in the config file may be?
Upvotes: 2
Views: 6896
Reputation: 5916
You should have using
statements to help dispose you ObjectContext. EF keeps an object graph of the queried objects. I think you could use objectContext.Detach(Entity);
to detach your entities from the ObjectContext.
Upvotes: 3