How to prevent Memory leak & outofmemory error ?
Hello Friends,
In our C#.NET 2005 Desktop application , in some Crystal reports "outofmemory error" comes while there are huge records. (used SQLReader & Dataset)
Also while user uses whole application for long time it increase "commit size memory" in Task manager . So how to reduce memory leak in application ?
Also we have used IDisposable interface & using statement wherever possible.
Also we have released "PrivateWorking set memory" wherever required.
but how to decide exactly from which place memory leaks & how to prevent it ?
what could be general cause which leads to memory leak & increase memory usage ?
Also is "outofmemory error" & commit size related to each other ?
Plz help
Thanks in Advance.

try abcPosted Jul 9, 2011, 12:36 AM
Sam HobbsPosted Jul 6, 2011, 3:45 PM
Note that Windows does not keep memory as clean as we want it to or think it does. If it does not need more meory, then it often does not bother to clean up memory. This is done for the purpose of efficiency; it is more efficient to not free memory when the processing is not needed.
What is the commited percent ("Memory, % Committed Bytes In Use" performance counter) value? If the percent value is below 90% then it might not be anything to be concerned about. Also, what is the "Memory, Available MBytes" counter? What is the "Memory, Pages Output/Sec" counter?
The problem might be some other memory configuration value, such as a buffer size. I am not familiar with Crystal Reports enough to really help with that.
Jiteendra SampathiraoPosted Jul 6, 2011, 8:30 AM
refer this...
Link 1
Link 2
hope it help you...