0

I am getting the following stack trace on a bunch of applications. They work fine for a couple of weeks and then one day - BOOM and every time ANY application is invoked it gives me the same error. Rebooting seems to buy me another couple of weeks. Here is the stacktrace I am seeing when the error occurs:

System.ComponentModel.Win32Exception: Not enough storage is available to process this command
   at System.Windows.Forms.NativeWindow.WindowClass.RegisterClass()
   at System.Windows.Forms.NativeWindow.WindowClass.Create(String className, Int32 classStyle)
   at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.Control.OnParentVisibleChanged(EventArgs e)
   at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Control.set_Visible(Boolean value)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at Ellin.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81

I googled this and everyone is talking about IRPStackSize but I don't know how it is relevant to this error as this stack trace has nothing to do with networking... The applications just die when they start running.

Denis
  • 11,796
  • 16
  • 88
  • 150
  • Can you share a segment of your code that is common among the apps where you see this error? Something that might be different from the WinForms defaults? – Austin Mullins Jul 28 '14 at 21:25
  • 2
    There is a single heap where apps on a specific desktop allocate from. Normally the user's desktop of course. When the desktop heap is out of storage then you'll get this error. That this crashes every app you start indicates that this leak probably is not caused by your app. You'll have to find the evil-doer, ask at superuser.com for guidance. – Hans Passant Jul 28 '14 at 21:44
  • how can I check the size of the desktop heap? – Denis Jul 29 '14 at 13:32
  • Is your application running for weeks? Maybe you are leaking UI resources. – usr Jul 29 '14 at 13:33
  • no, that application starts and closes many times during the day. Unfortunately I can't really pinpoint the code that is causing this so can't really share the whole application. – Denis Jul 29 '14 at 14:41
  • Did you ever resolve this? I'm asking because I've noticed a new question that might be related: http://stackoverflow.com/questions/28920550/win32exception-not-enough-storage-is-available-to-process-this-command-error-w#comment46204467_28920550 – RenniePet Mar 11 '15 at 01:46

0 Answers0