none
App crash on win mobile 6.5 RRS feed

  • Question

  • I need help, my friend opened a restaurant, and bought four Widefly WF 43 devices (http://www.touchdynamic.com/products.aspx?prdid=17250), they are running Win mobile 6.5, from the same firm he also bought a simple POS application for those devices so that waiters can make orders directly from the device.

    Problem is that application is crashing, with this error:

    WinCEWaiter.exe
    OutOfMemoryException

    at Microsoft.AGL.Common.MISC.HandleAr()
    at System.Drawing.Bitmap._Init()
    at System.Drawing.Bitmap..ctor()
    at System.Windows.Forms.GridRenderer._Render()
    at System.Windows.Forms.DataGrid.OnPaint()
    at System.Windows.Forms.Control.WnProc()
    at System.Windows.Forms.Control._InternalWnProc()
    at Microsoft.AGL.Forms.EVL.EnterMainLoop()
    at System.Windows.Forms.Application.Run()
    at WinCEWaiter.Program.Main()

    After this Error message is closed, program starts again normaly, and again crashes after a while. This is not offten, 2-3 times a day...

    That firm sold that program previously on Widefly WF 35 device that was running Windows CE 5.0, and that problem was not occuring on that platform, so that program is originaly for win ce 5.0. So i'm guessing that a problem is in windows platform.

    So can somebody please tell me what the problem is from this error message? and how to solve it?

    I apologize for my bad english.

    Thursday, August 2, 2012 12:12 PM

Answers

  • If you check the stack trace above you would see it run out of memory creating a bitmap. So it uses bitmaps for sure.

    It is also creating bitmap in a paint event which is called every time screen redraws. That means this bitmap is created over and over again. If it's not disposed of properly memory leak may occur.

    Bitmap is a .Net object which represents a raster image. It is not directly related to .BMP image file format and can load pretty much any image files.

    There are tools to monitor memory but since you don't have sources I don't see how it would help you.

    If you can contact developer you should probably ask what they: 

    1. Add error handling so application would not crash but exit gracefully or would keep going if error is not critical instead of crashing.

    2. Audit source code to make sure they properly dispose of all the graphics and forms objects.

    Just an addition: bitmaps can be used internally for buffering which is what may be going in here. In that case developer is not in direct control. However both actions still apply.


    This posting is provided "AS IS" with no warranties, and confers no rights.


    Friday, August 3, 2012 4:41 PM
    Moderator

All replies

  • It seems like application simply run out of memory. This is a rather common issue on Windows Mobile and Windows CE 5.0 (on which WM 5+ is based). The problem is what application cannot use more than 32MB of virtual memory (in practice usually less than that, say 28MB) even if device has more.

    Applications handing bitmaps are running into that issue rather often as small 1 MB bitmap is in fact so huge in decompressed form, it can take out half the available memory.

    If you have source code for this application you would need to do memory profiling and figure out if you're properly disposing of bitmaps you no longer need. 

    Also if you're using custom bitmaps try reducing the resolution. E.g. use 640x480 bitmaps instead of 4000x3000 bitmaps.


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, August 2, 2012 4:24 PM
    Moderator
  • I don't have the source code, so i cant know exactly what is happening in the code, but as far i can see the program is not using bitmpas (pictures in any way), that therm counfuses me, because as far as i know a bitmap is an image file format?, or am i wrong? program only uses a few .txt files where the information is stored, like waiter code and name, dishes, drinks that are in the program, and those .txt files are only few KB big,  and can you please tell me what is throwing this error, OS, net framework or what?

    And if there is an app to monitor this WinCEWaiter.exe program? to see, for an example, graphicly memory usage in certain time period...?

    Thank you for your help! 
    Friday, August 3, 2012 4:03 PM
  • If you check the stack trace above you would see it run out of memory creating a bitmap. So it uses bitmaps for sure.

    It is also creating bitmap in a paint event which is called every time screen redraws. That means this bitmap is created over and over again. If it's not disposed of properly memory leak may occur.

    Bitmap is a .Net object which represents a raster image. It is not directly related to .BMP image file format and can load pretty much any image files.

    There are tools to monitor memory but since you don't have sources I don't see how it would help you.

    If you can contact developer you should probably ask what they: 

    1. Add error handling so application would not crash but exit gracefully or would keep going if error is not critical instead of crashing.

    2. Audit source code to make sure they properly dispose of all the graphics and forms objects.

    Just an addition: bitmaps can be used internally for buffering which is what may be going in here. In that case developer is not in direct control. However both actions still apply.


    This posting is provided "AS IS" with no warranties, and confers no rights.


    Friday, August 3, 2012 4:41 PM
    Moderator
  • Thanky you for your help, i will redirect this to the developer, and hopefully resolve this issue
    Friday, August 3, 2012 7:50 PM
  • I redirected all the information to the developer. I tried an older device WF 35, wich is running Windows CE 5.0 and these errors do not occur on that device. I tried installing a .Net framework 3.5 on the devices running Win mobile 6.5, but nothings changed, errors still occur. I don't understand why this error is not occuring on Windows CE 5.0, but only on win mobile 6.5? and as i can see Win mobile 6.5 is based on CE...
    Monday, August 6, 2012 1:56 PM
  • I would say that's because these are different devices running different OS. For example, what is the amount of virtual memory available on both?

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, August 6, 2012 3:42 PM
    Moderator
  • On Mon, 6 Aug 2012 13:56:58 +0000, RafaelCRO wrote:

    I redirected all the information to the developer. I tried an older device WF 35, wich is running Windows CE 5.0 and these errors do not occur on that device. I tried installing a .Net framework 3.5 on the devices running Win mobile 6.5, but nothings changed, errors still occur. I don't understand why this error is not occuring on Windows CE 5.0, but only on win mobile 6.5? and as i can see Win mobile 6.5 is based on CE...

    Windows Mobile 6.5 is based on Windows CE 5.0, but adds and removes some things. So it is
    quite possible for apps to behave differently, and even run on only one. In particular,
    the menus are completely different and use different function calls (not sure this
    specific difference is relevant, but it is a valid example).
    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret
    PenFact, Inc.
    20 Park Plaza, Suite 400
    Boston, MA 02116
    www.penfact.com
    r_z_aret@pen_fact.com
    Useful reading (be sure to read its disclaimer first):
       http://catb.org/~esr/faqs/smart-questions.html

    Thursday, August 9, 2012 7:33 PM