Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27064

OutOfMemoryException

$
0
0
In one of my vb.net application i am getting error while running the application.This error does not come always.So i am not able to reproduce the error also.No exact sequence also to reproduce the error.
Code:

Stack :System.OutOfMemoryException: Out of memory.

  at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)

  at System.Windows.Forms.ToolStrip.OnPaint(PaintEventArgs e)

  at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)

  at System.Windows.Forms.Control.WmPaint(Message& m)

  at System.Windows.Forms.Control.WndProc(Message& m)

  at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

  at System.Windows.Forms.ToolStrip.WndProc(Message& m)

  at System.Windows.Forms.StatusStrip.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)

Err desc:          MyApplication_UnhandledException

After this error i got message saying "Insufficient memory to create bitmap. Close one or more applications to increase available."

When i checked the memory usage of the application it was not that high. This error does not appear repeatedly. So how i can troubleshoot this error. how it can be solved?
I checked running my application by using .net memory profiler and redgate memory profiler.
Below is a screenshot of the amounts of unmanaged memory usage.I don't know properly whether these values are high.

Name:  untitled.jpg
Views: 81
Size:  123.5 KB
Attached Images
 

Viewing all articles
Browse latest Browse all 27064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>