I have a multi threading console application that written in C# and Entity Framework 4.0.
Yesterday, when I monitored the program for couple hours, it uses about 100MB, but this morning it becomes 500MB. Just wondering if EF will eventually become big because of caching?
Or should I somehow refresh it?
Thanks in advance.
How are you checking the memory usage, if you are using Task Manager then it does not reflect the correct memory usage. Its better if you use some memory profiler for .Net, also see What Are Some Good .NET Profilers?. You can also try dotTrace to see which object is taking memory.
try disabling
ContextOptions.LazyLoadingEnabledunder your data context and see if it helps, but I still think using a memory profiler would give you a clear picture of what is going on with your applicaiton.