Out of Memory?

When using my application I seem to get an Out of Memory error at random. I cannot find any common "action" that leads to this. additionally it occurs more frequently when the application is either minimized for more then 5 minutes or is a background window (not the active application) for more then 3-5 minutes. It doesn't happen all the time. I seem to only get it once a week at most. It does not seem to occur when the application is the active window. It's a web browser application and uses the WebBrowser control. it is running on a system with IE6 all latest patches. what's wierd is that I would expect this to occur when the application is the active window not a backgrounded window. any ideas

Answer this question

Out of Memory?

  • dagma20

    Well I will have to look alot deeper. There really isn't much happening behind the scenes. The only thing I can think of is maybe a disposed object but, I have checked through the code and any places where a control or object is requested it is either there or, is generated before being called. now, I do allow garbage collection to take care of disposing unused objects and I generally do not null or manually dispose my objects. should I be doing this or, is allowing GC to take care of it all ok
  • mad Mazz

    You don't get OutOfMemory exceptions in idle processes, so what are you doing on the background


  • He Hua

    I was able to find the common link for this issue. I have (during extensive searching) that when the application with the webbrowser control is open at the same time as microsoft money 2006 the webbrowser control would crash. more specifically it would crash right when you select your account registry in MSMoney 2006. Sounds weird but that is the only time it occurs. I took the webbrowser control out of the program and it never crashed. also the program never crashed unless msmoney was running so...
  • PuTeFabiO

    I am sorry. Yeah PJ. van de Sande is right. Actually I had the same problem. When I debuged the application I got one of my object is null and i am trying to access that variable and getting the same exception. This lead to wrong direction.

  • Jangu

    I'm glad the problem is solved.

    Thanks you very much for the late but answering reply!


  • G. Miller

    I don't agree with iamunmad, when you try to use a Disposed object a ObjectDisposedException is thrown. A OutOfMemoryException normally occurds normally when there is not enough memory to continue the execution. This can also be the stack that can be full very quickly when a get property that refers to itself or a endless loop that builds a buffer and more then thousand other scenarios.


  • iproetel

    Out of Memory exceptions occurs only when the application trying to access a variable/object which is out of scope or disposed. Out of scope object will be identified by compilier. But if u dispose a object and try to access the object then the application will throw OutOfMemory Exceptions.

    Debug your application and check from which line the exception is occuring.



  • Out of Memory?