views:

151

answers:

4

While Compiling the WPF Application for many times in a day it give following error

'Exception of type 'System.OutOfMemoryException' was thrown.'

Can anyone know why this error occured and how to remove that error.

But if visual studio is restarted then there is no such problem.

thanks in advance

+1  A: 

This happens to me frequently with visual studio 2008. I just assume there's a memory leak somewhere due to poor coding on Microsoft's part. Whenever i see this error I close down and reopen visual studio and it compiles without a hitch.

diadem
I guess looking for updates would be recommended.
MPelletier
Why the MS dig? Is your code bug free?
Adrian
My code is not at all bug free. Nobody's is, and I think that's the point.. My code is not yet running, visual studio is. The out of memory error was caused by visual studio running out of memory while trying to *compile* my code. This error goes away when visual studio is closed and reopened. This series of events show that a memory leak on Visual Studio's part (or an associated tool) is the most likely scenario.
diadem
Ah, I guess the "poor coding" bit was uncalled for. Creating a compiler as large as Visual Studio can not be easy, so I apologize for that comment. The Microsoft Engineers I have meet are all top notch. Do I still believe the problem lies in visual studio? Yes. Do I believe that is a sign of poor coding? No, it's a sign of not being perfect, which no one is.
diadem
+2  A: 

It could be that your compiler has a memory leak, or that a plugin of your compiler has a memory leak.

There is not your fault, though. It's most probably your compiler's fault. You are encouraged to reproduce the problem and send it to your compiler vendor for a detail investigation.

Ngu Soon Hui
A: 

Is your machine up to the minimum specification for developing WPF applications

Adrian
The OP problem is that the `OutOfMemoryException` was thrown when the machine was compiling the code many times over, so it's more likely a memory leak issue rather than machine spec issue
Ngu Soon Hui
Agreed, but VS will run in machines of lower spec than the recommendation. While it appears to work it will cause OOM exceptions eventually. The question is too vague and there is not enough information provided for anyone to answer...
Adrian
+1  A: 

It sounds like you are saying that after compiling a WPF application many times in Visual Studio you receive an OutOfMemoryException error. Can you elaborate further on where exactly this error shows up?

  • In the Designer
  • In the output window
  • etc ...

It's possible that there is a bug in either a 3rd party hosted control on the designer or in Visual Studio itself. If you are not using any 3rd party controls then I encourage you to file a bug on connect for the issue.

JaredPar