OutOfMemoryException : Big problems

  • Thread starter Thread starter Peter Morris [Droopy eyes software]
  • Start date Start date
P

Peter Morris [Droopy eyes software]

This is causing me no end of grief! The call stack is:

at Microsoft.AGL.Common.MISC.HandleAr()
at System.Windows.Forms.Control._InitInstance()
at System.Windows.Forms.Control..ctor()

At the point the exception occurs I usually have about 7MB of free RAM.
This seems to occur because

1) My app is creating a UserControl and displaying it in a 250ms timer
(disposing the previous control first)
2) The user goes off and views files in file explorer, checks the battery
levels, etc.

If the user is using other apps then the UserControl constructor sometimes
fails. Once it has failed I cannot create any new UserControl instances, if
I put a loop with a Thread.Sleep(250) trying to recreate the control once
OutOfMemoryException is encountered it still does not work.

I am really hoping that someone knows something about this. It is beyond my
control, it looks like a WinCE error or a CF V2.0 error but I cannot
reproduce it in a small simple application.


Thanks

Pete
 
Hi Peter,

Did you have bitmap object in your custom control, if it the case, try
to Dispose the Bitmap object.

BR


Fabien Decret
Windows Embedded Consultant
C# MCP


ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/


Peter Morris [Droopy eyes software] a écrit :
 
Hi

The user controls consist only of Labels, TextBoxes or RadioButtons, and
sometimes a SmartGrid. I have experienced this problem on controls that
consist only of

DescriptionLabel
YesRadioButton
NoRadioButton

The problem *only* occurs of the user is also actively using another
application. I can reproduce it in my own app if I select / deselect
folders in the Program Manager repeatedly.

I'd swear this is a problem in WinCE or CF 2, but I cannot reproduce it in a
more simple (releasable) application!


Pete
 
Back
Top