Home > Support > Forum

Out of Memory

Posted by vpalhories 
Out of Memory
September 29, 2011 02:56PM
Hello,

We're trying to design some Proof of Concept forms. As such, the forms have no logic other than the basics for navigation. On a number of occasions, I've had the following error:

OutOfMemoryException

This happens on the following line in the .Designer.cs file: this.kbdBase.BKDFile = "ASDFKeyboard.bkd";

at System.String.Concat(String[] values)
at System.String.Concat(String str0, String str1)
at System.Xml.XmlReader.ReadString()
at System.Xml.XmlTextReaderImpl.ReadString()
at System.Xml.Serialization.XmlSerializationReader.DeserializePrimitiveElement(LogicalType deserializeAs, Accessor accessor, Fixup fixup, Object fixupTarget, String identifier, Boolean emptyValue, Boolean nullValue)
at System.Xml.Serialization.XmlSerializationReader.deserializeElement(Accessor accessor, Fixup fixup, Object fixupTarget)
at System.Xml.Serialization.XmlSerializationReader.DeserializeElementMember(MemberValueCollection members, Object fixupTarget, Hashtable internalState, Boolean& firstElement)
at System.Xml.Serialization.XmlSerializationReader.deserializeMembers(MemberValueCollection members, Object fixupTarget)
at System.Xml.Serialization.XmlSerializationReader.DeserializeComplexElement(LogicalType deserializeAs, Accessor accessor, Fixup fixup, Object fixupTarget, String identifier, Boolean emptyValue, Boolean nullValue)
at System.Xml.Serialization.XmlSerializationReader.deserializeElement(Accessor accessor, Fixup fixup, Object fixupTarget)
at System.Xml.Serialization.XmlSerializationReader.DeserializeElement(Accessor accessor, Fixup fixup)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
at BeeMobile.Keyboard.KeyboardControl.#=qCBdl5I2jtP7GSTLIj7DtFg==(String #=q9EIEJnnoVnWBupZrapAK5A==)
at BeeMobile.Keyboard.KeyboardControl.set_BKDFile(String value)
at FSAStory.frmEnterQuantities.InitializeComponent()
at FSAStory.frmEnterQuantities..ctor()
at FSAStory.frmItemDetail..ctor()
at FSAStory.frmService.doService()
at FSAStory.frmService.btnPerformService_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at BeeMobile.TransparentControls.TVistaButton.OnClick(EventArgs e)
at BeeMobile.TransparentControls.TVistaButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
at System.Windows.Forms.Form.ShowDialog()
at FSAStory.frmAppointment.DoFSAStory()
at FSAStory.frmAppointment.btnGPS_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at BeeMobile.TransparentControls.TVistaButton.OnClick(EventArgs e)
at BeeMobile.TransparentControls.TVistaButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
at System.Windows.Forms.Form.ShowDialog()
at FSAStory.frmMenu.ShowFSADemoScreens(Int32 soCount)
at FSAStory.frmMenu.StartDemo()
at FSAStory.frmMenu.timer1_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer._WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.ApplicationThreadContext._InternalContextMessages(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
at System.Windows.Forms.Form.ShowDialog()
at FSAStory.FrmLogon.Login()
at FSAStory.FrmLogon.btnLogon_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at BeeMobile.TransparentControls.TVistaButton.OnClick(EventArgs e)
at BeeMobile.TransparentControls.TVistaButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
at System.Windows.Forms.Form.ShowDialog()
at FSAStory.frmSelectStory.Login()
at FSAStory.frmSelectStory.btnFieldService_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at BeeMobile.TransparentControls.TVistaButton.OnClick(EventArgs e)
at BeeMobile.TransparentControls.TVistaButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
at System.Windows.Forms.Application.Run(Form fm)
at FSAStory.Program.Main()

Any ideas on what might be happening?

Thanks

--- Val
Re: Out of Memory
October 04, 2011 02:27AM
Hello Val,

please send me your BKD file.
You can either upload it here into the forum post or feel free to send it via e-mail.

Thank you!

Best regards,
Gabriel
the BeeMobile team
Re: Out of Memory
October 04, 2011 07:00AM
Good morning Gabriel. I've sent you the keyboard file via email.

--- Val
Re: Out of Memory
October 24, 2011 03:36AM
Hi Val,

I just want to share the hint with other readers of this topic that I've sent you.

Please watch this short video:
[msdn.microsoft.com]

It introduces a tool to detect memory leaks. KeyboardControl needs more memory because every key (normal and pressed) are prepared bitmaps. They should be prepared to have short response time.

Do you dispose IDisposable objects (e.g.Forms, Bitmaps, Font, Stream, Region, Pen, Brush) when you do not need them? It is recommended to clean the memory.

Please check your application with .NETCF Remote Performance Monitor tool and try to avoid memory leaks in your code. That should solve the issue.

Best regards,
Gabriel
the BeeMobile team
Re: Out of Memory
October 29, 2011 05:27PM
I'm getting exactly the same issue.
I have watched the video, ran the Remote Performance Monitor, and not losing memory that I can see. But still randonly (appears to be random anyway), get this exception. I was monitoring system memory too and the last one I just got there was over 30mb of memory available just before the exception was thrown.

This is the line of code,
this.keyboardControl1.BKDFile = "NumericKeyboardVGA.bkd"
If I comment just this line out, so no layout is loaded, the problem disappears.
So pretty certain the control itself is causing this.

Spent the whole weekend troubleshooting this one. Means a big demo planned for Monday goes out the window,
Bitterly disappointed.
If I'm wrong, I'll take it all back, but I can't see any other explanation at the moment.
Re: Out of Memory
October 29, 2011 06:05PM
Forgot to add stack trace, in case it helps.
Looks like something to do with the graphics/bitmaps.


StackTrace "at Microsoft.AGL.Common.MISC.HandleAr()\r\nat System.Drawing.Bitmap._InitFromMemoryStream()\r\nat System.Drawing.Bitmap..ctor()\r\nat BeeMobile.Keyboard.Keyboard.set_KeyboardBackgroundArr()\r\nat System.Reflection.RuntimeMethodInfo.InternalInvoke()\r\nat System.Reflection.RuntimeMethodInfo.InternalInvoke()\r\nat System.Reflection.RuntimeMethodInfo.Invoke()\r\nat System.Reflection.MethodBase.Invoke()\r\nat System.Reflection.RuntimePropertyInfo.SetValue()\r\nat System.Xml.Serialization.SerializationHelper.SetValue()\r\nat System.Xml.Serialization.MemberFixup.AssignValue()\r\nat System.Xml.Serialization.AssigningFixup.fixup()\r\nat System.Xml.Serialization.XmlSerializationReader.RunFixup()\r\nat System.Xml.Serialization.XmlSerializationReader.DeserializePrimitiveElement()\r\nat System.Xml.Serialization.XmlSerializationReader.deserializeElement()\r\nat System.Xml.Serialization.XmlSerializationReader.DeserializeElementMember()\r\nat System.Xml.Serialization.XmlSerializationReader.deserializeMembers()\r\nat System.Xml.Serialization.XmlSerializationReader.DeserializeComplexElement()\r\nat System.Xml.Serialization.XmlSerializationReader.deserializeElement()\r\nat System.Xml.Serialization.XmlSerializationReader.DeserializeElement()\r\nat System.Xml.Serialization.XmlSerializer.Deserialize()\r\nat System.Xml.Serialization.XmlSerializer.Deserialize()\r\nat BeeMobile.Keyboard.KeyboardControl.#=qZG74hT$85vemRJ09ezf_vA==()\r\nat BeeMobile.Keyboard.KeyboardControl.set_BKDFile()\r\nat PdaAudits.SmartForm.keyboard_KeyUp()\r\nat System.Windows.Forms.Control.OnKeyUp()\r\nat BeeMobile.Keyboard.KeyboardControl.OnMouseUp()\r\nat System.Windows.Forms.Control.WnProc()\r\nat System.Windows.Forms.ContainerControl.WnProc()\r\nat System.Windows.Forms.Control._InternalWnProc()\r\nat Microsoft.AGL.Forms.EVL.EnterModalDialog()\r\nat System.Windows.Forms.Form.ShowDialog()\r\nat PdaAudits.frmCase._Action_Attend()\r\nat PdaAudits.frmCase._InvokeAction()\r\nat PdaAudits.CaseActionMenu.Action_Click()\r\nat System.Windows.Forms.Control.OnClick()\r\nat BeeMobile.TransparentControls.TVistaButton.OnClick()\r\nat BeeMobile.TransparentControls.TVistaButton.OnMouseUp()\r\nat System.Windows.Forms.Control.WnProc()\r\nat System.Windows.Forms.ContainerControl.WnProc()\r\nat System.Windows.Forms.Control._InternalWnProc()\r\nat Microsoft.AGL.Forms.EVL.EnterModalDialog()\r\nat System.Windows.Forms.Form.ShowDialog()\r\nat PdaAudits.EntityLauncher.OpenCase()\r\nat PdaAudits.EntityLauncher.OpenCase()\r\nat PdaAudits.frmCaseSearch._ItemSelected()\r\nat PdaAudits.TouchList._ItemSelected()\r\nat PdaAudits.TouchList.lstItems_SelectedIndexChanged()\r\nat BeeMobile.TouchList.#=qWcDiXSiJNNxbeBils$sWDIdiM3mhw5BeI$T$DiWdaRE=()\r\nat BeeMobile.TouchList.#=qf0JqD5$OEQXSbkhIA7QBT7qgcrmorPafKSV0AcUpoposSrjT1tWQ3OpJTUPPx_hW()\r\nat #=qu2CFr_i6X58wILHSx8CwX4VVrqsSPXjSXGJG3oZ2Vn4=.#=qjcCnxcTvoQ6NmXrQXMYfHG8H9h2fE$D6GJjKunWOwsU=()\r\nat #=qu2CFr_i6X58wILHSx8CwX4VVrqsSPXjSXGJG3oZ2Vn4=.#=qnzIgPR3pK5KcMErbb0_D4g==()\r\nat #=qu2CFr_i6X58wILHSx8CwX4VVrqsSPXjSXGJG3oZ2Vn4=.OnMouseUp()\r\nat System.Windows.Forms.Control.WnProc()\r\nat System.Windows.Forms.ContainerControl.WnProc()\r\nat System.Windows.Forms.Control._InternalWnProc()\r\nat Microsoft.AGL.Forms.EVL.EnterModalDialog()\r\nat System.Windows.Forms.Form.ShowDialog()\r\nat PdaAudits.frmDashboard._ViewCasesHome()\r\nat PdaAudits.frmDashboard._ToolbarCommand()\r\nat PdaAudits.TouchToolbar._InvokeCommand()\r\nat PdaAudits.TouchToolbar._InvokeCommand()\r\nat PdaAudits.TouchToolbar.tbMain_SelectedToolIndexChanged()\r\nat BeeMobile.ToolBar.ToolBar.OnSelectedToolIndexChanged()\r\nat BeeMobile.ToolBar.ToolBar.set_SelectedToolIndex()\r\nat BeeMobile.ToolBar.ToolBar.OnMouseUp()\r\nat System.Windows.Forms.Control.WnProc()\r\nat System.Windows.Forms.ContainerControl.WnProc()\r\nat System.Windows.Forms.Control._InternalWnProc()\r\nat Microsoft.AGL.Forms.EVL.EnterModalDialog()\r\nat System.Windows.Forms.Form.ShowDialog()\r\nat PdaAudits.UserLogin._ShowDashboard()\r\nat PdaAudits.UserLogin._Logon()\r\nat PdaAudits.UserLogin.btnLogin_Click()\r\nat System.Windows.Forms.Control.OnClick()\r\nat BeeMobile.TransparentControls.TVistaButton.OnClick()\r\nat BeeMobile.TransparentControls.TVistaButton.OnMouseUp()\r\nat System.Windows.Forms.Control.WnProc()\r\nat System.Windows.Forms.ContainerControl.WnProc()\r\nat System.Windows.Forms.Control._InternalWnProc()\r\nat Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\nat System.Windows.Forms.Application.Run()\r\nat PdaAudits.Program.Main()\r\n" string
Re: Out of Memory
November 02, 2011 08:54AM
Hi Philc,

thanks for your feedback.
We will review the source code and try to solve memory issues.
I will let you know if there is a new version available.
Thanks again!

Best regards,
Gabriel
the BeeMobile team
Re: Out of Memory
February 02, 2012 09:26AM
Hello vpalhories and philc,

we have just released a new version of KeyboardControl which you can download from the customer web portal. The new version contains several optimizations towards less memory consumption.

Mainly, the BKD files are much smaller now. The new version is backwards compatible of course which means it will be able to deal with old BKD files. However, you can open your old BKD files in Keyboard Designer and save them anew. That will automatically convert them to the newer (smaller) version.

Best regards
Vladimir Gregor
Bee Mobile | Skype ID: beemobile_support | Phone: +421 94 88 99 22 9 | Email: support at beemobile4 dot net
Re: Out of Memory
February 02, 2012 12:18PM
Awesome!


Thanks Vladimir. I'll let you know if we have any more problems.

--- Val
Re: Out of Memory
February 02, 2012 07:30PM
Vladimir,

Can you tell me if the Bee Mobile iPack 2012 (BeeMobile_iPack.msi) contains all of the latest versions of the other components? I remember that the last time it did not.

As a suggestion, you might want to put the date that the iPack 2012 was last updated. It would remove a lot of guess work!

Thanks again.

--- Val
Re: Out of Memory
February 03, 2012 03:46AM
Hello Val,

yes, the latest iPack installer (available on the customer portal) contains all of the latest versions of controls.

Thanks for the great suggestion, we have also implemented it.

Best regards
Vladimir Gregor
Bee Mobile | Skype ID: beemobile_support | Phone: +421 94 88 99 22 9 | Email: support at beemobile4 dot net
Sorry, only registered users may post in this forum.

Click here to login