none
The exception 'System.OutOfMemoryException' RRS feed

  • Question

  • System Specification - Windows 7 [ 64 Bit ]

    "APPLICATION" - Its Running as a 32 Bit Application in Same Environment

    Build -  " APPLICATION " - Its Build on 32 bit machine with visual studio 2002 & Running on the Above Mentioned System i.e. 64 Bit Windows 7

    This exception comes when i Try to open one of the windows form of MyApplication, while rest of the forms are not showing such trait.

    RAM - 3966 MB

    VM   - 5949 MB

    At The Time Of Crash 

    RAM - 1595 MB

    ************** Exception Text **************
    System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
    at System.Windows.Forms.UnsafeNativeMethods.GetWindowText(HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount)
    at System.Windows.Forms.Control.get_WindowText()
    at System.Windows.Forms.Control.set_CacheTextInternal(Boolean value)
    at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
    at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
    at System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, String property)
    at System.Windows.Forms.Control.OnResize(EventArgs e)
    at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
    at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
    at System.Windows.Forms.Control.UpdateBounds()
    at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.AxHost.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    Application
    Assembly Version: 1.0.4885.30511
    Win32 Version: 1.0.4885.30511
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/Application.exe
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
    ----------------------------------------
    Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    Routines
    Assembly Version: 1.0.4885.30509
    Win32 Version: 1.0.4885.30509
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/Routines.DLL
    ----------------------------------------
    Csd
    Assembly Version: 1.0.4885.30508
    Win32 Version: 1.0.4885.30508
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/Csd.DLL
    ----------------------------------------
    System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Transactions
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
    ----------------------------------------
    System.EnterpriseServices
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    Interop.Word
    Assembly Version: 8.3.0.0
    Win32 Version: 8.3.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/Interop.Word.DLL
    ----------------------------------------
    AxInterop.MSComctlLib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/AxInterop.MSComctlLib.DLL
    ----------------------------------------
    AxInterop.SHDocVw
    Assembly Version: 1.1.0.0
    Win32 Version: 1.1.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/AxInterop.SHDocVw.DLL
    ----------------------------------------
    AxInterop.MSFlexGridLib
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/AxInterop.MSFlexGridLib.DLL
    ----------------------------------------
    Interop.SHDocVw
    Assembly Version: 1.1.0.0
    Win32 Version: 1.1.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/Interop.SHDocVw.DLL
    ----------------------------------------
    Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    mscomctl
    Assembly Version: 10.0.4504.0
    Win32 Version: 10.0.4504
    CodeBase: file:///C:/Windows/assembly/GAC/mscomctl/10.0.4504.0__31bf3856ad364e35/mscomctl.dll
    ----------------------------------------
    Interop.MSComctlLib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/Interop.MSComctlLib.DLL
    ----------------------------------------
    Interop.MSFlexGridLib
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/APPLICATION/ApplicationGUI/Interop.MSFlexGridLib.DLL
    ----------------------------------------
    System.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
    ----------------------------------------
    Wednesday, May 22, 2013 7:36 AM

Answers

  • Sometimes errors like these are due to a null pointer or access priviledges.  Make sure the form is getting rebuilt.  Also get the Error window and output windows in the View menu to make sure no warning are generated when you do a build.  Make sure you see "Build Succeeded" in bottom left corner of VS after you build.   I normally delete the project bin file to force everything to get rebuilt. 

    If this doesn't solve the problem you have an issues in either the form constructor, the form Load, or the form designer file.  I would start by commenting sections of the code to help isolate where the problem is located.  Make sure yur build option is using x86 mode.

    Do all your forms contain a WebBrowser or just the one that is failing.  I see from the Loaded Assemblies that you have System.Web.dll and Interop.SHDocVw.DLL.  The SHDocVw.dll is an old dll that contains an IE object (I think arround IE6).   Sometimes I see conflicts between these two lbirary classes because they contain the same properties and methods.


    jdweng

    Wednesday, May 22, 2013 10:24 AM
  • Just because it's running on a 64 bit OS, doesn't mean that it's not still a 32 bit process.

    Other times the problem could be that the process is trying to create one giant data structure and the Large Object Heap is so fragmented that there's no space left to grow.

    Wednesday, May 22, 2013 11:36 PM

All replies

  • Sometimes errors like these are due to a null pointer or access priviledges.  Make sure the form is getting rebuilt.  Also get the Error window and output windows in the View menu to make sure no warning are generated when you do a build.  Make sure you see "Build Succeeded" in bottom left corner of VS after you build.   I normally delete the project bin file to force everything to get rebuilt. 

    If this doesn't solve the problem you have an issues in either the form constructor, the form Load, or the form designer file.  I would start by commenting sections of the code to help isolate where the problem is located.  Make sure yur build option is using x86 mode.

    Do all your forms contain a WebBrowser or just the one that is failing.  I see from the Loaded Assemblies that you have System.Web.dll and Interop.SHDocVw.DLL.  The SHDocVw.dll is an old dll that contains an IE object (I think arround IE6).   Sometimes I see conflicts between these two lbirary classes because they contain the same properties and methods.


    jdweng

    Wednesday, May 22, 2013 10:24 AM
  • Just because it's running on a 64 bit OS, doesn't mean that it's not still a 32 bit process.

    Other times the problem could be that the process is trying to create one giant data structure and the Large Object Heap is so fragmented that there's no space left to grow.

    Wednesday, May 22, 2013 11:36 PM