Results 1 to 9 of 9

Thread: OutOfMemoryException

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    205

    OutOfMemoryException

    What might be the cause for the following during run time? Am I not freeing something?

    ------------------------
    An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll

    Additional information: Error creating window handle.

  2. #2
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: OutOfMemoryException

    What is your app doing when the error is encountered?
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: OutOfMemoryException

    When and where did this happen? Feel free to provide any information that may be relevant.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: OutOfMemoryException

    Quote Originally Posted by jmcilhinney
    Feel free to provide any information that may be relevant.
    You crack me up!
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    205

    Re: OutOfMemoryException

    Oh, the problem is gone now... hmmm ... don't know why, I keep hitting ctrl-z to delete whatever I changed earlier, I guess that helps...

    I loaded my main page with no problem, then when I tried to bring up a child screen, it died loading this child page. The routine it died at was a button click sub.

    Anyways, do I need to worry about memory problem?

  6. #6
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: OutOfMemoryException

    Quote Originally Posted by newtovbnet
    Anyways, do I need to worry about memory problem?
    With unmanaged code you should always be sure to dispose objects so they can be released back to open memory. Otherwise, you can fill up the RAM leaving no room for anything else.
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    205

    Re: OutOfMemoryException

    So when I close the form, I should always dispose() for OleDbConnection, dataset, datatable etc?

  8. #8
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: OutOfMemoryException

    Closing the form will automatically dispose it's objects, but if you have a sub that may run several times throughout the life of the form, then you need to make sure the objects in the sub are properly disposed.
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    205

    Re: OutOfMemoryException

    I see. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width