Usman Iqbal
Usman Iqbal

Reputation: 1

System.OutOfMemoryException error

We are working on a rich client application in which many threads are running as well third party controls are used, after running application for 1 hour it starts giving error of 'System.OutOfMemoryException' unless and until we restart the application, i have search many sites for help but no particular and specified reason is giving.

Thanks.

Upvotes: 0

Views: 1144

Answers (2)

Stochastically
Stochastically

Reputation: 7846

It sounds pretty self-explanatory, you're system doesn't have enough memory. If you're still running the application as 32-bit then moving to 64-bit might solve the problem. I had exactly that problem on a server-2008-r2 recently, and moving to 64 bit did solve my problem. But if you're already 64 bit then perhaps the server doesn't have enough physical memory. In which case, you need to add more memory, or work out how to make your application less memory hungry. There could be objects that could be discarded that it's keeping references to, etc, and if that's the case you should try profiling to try and identify what's hogging the most memory. Beyond that, does the application use any unmanaged DLLs, e.g. COM objects written in C++ or similar. Maybe there's a memory leak outside of the managed framework?

Upvotes: 2

Samy Dindane
Samy Dindane

Reputation: 18746

I recommend using a profiler to identify and find where does the high memory consumption come from.

Upvotes: 0

Related Questions