I’m maintaining an existing application and I’ve encountered a bug when running under some conditions (easily reproducible), where the app fails with message :
- Title: “Windows – Out of virtual memory”
- Content: “Windows is low in virtual memory…”
Question is: what I need to check first? When is this message happening? Why?
What is stored in this virtual memory in C#, why an out of memory?
It sounds like you have a memory or resource leak of some kind. Time to crack open a profiler and see what’s consuming resources or memory.
Good profilers include
http://www.red-gate.com/products/dotnet-development/ants-performance-profiler
and
http://memprofiler.com/
— this will attach to your running process and see what’s out of control.
In general this kind of issue can be caused by objects that implement
IDisposablenot being disposed through a call toDispose(). The memory and resources used by these objects are not managed by the .NET garbage collector so (unlike regular .NET objects) they won’t be tidied up by the system automatically.A profiler will usually tell you if this is an issue.
There are other situations where this can happen, for instance
Again, a profiler will tell you where the problem is likely to lie.