Results 1 to 14 of 14

Thread: [Resolved] Are compact framework applications usually this heavy?

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    [Resolved] Are compact framework applications usually this heavy?

    Hello, my first venture into mobile development. I've been fiddling around with simple forms in a smart device application (Windows Mobile 6). One thing I've noticed is that no matter how simple the application, the memory consumption is... large. Let me explain.

    I created a simple form with a button on it. No code written yet. I created a CAB for it (release build), sent it over to the device, installed, ran it. Then I checked the task manager and it showed 300K!

    Other applications are usually about 30K or 50K, but my simple form was about 300K. I was wondering, perhaps this is related to the compact framework being loaded as well, but a search showed me nothing. It's like nobody talks about it, perhaps you guys could have a look. Do you observe the same thing?
    Last edited by mendhak; Dec 6th, 2008 at 06:31 AM.

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Are compact framework applications usually this heavy?

    Another question - do GPS/Serial Port applications also add to the memory footprint? Continuing on my form from above, I am now reading GPS data from COM1, constantly, and the memory footprint now hovers at about 590K. When I start logging it all to a textbox, it reaches 800K.

    Is any of this normal?

    In fact, I opened up a bunch of applications and here is what I got:

    Opera Mini: 347K
    Bubble Breaker: 7K
    Windows Live Mail: 287K
    IE: 1300K
    Google Maps: 1020K

    But these are large applications, which is why I thought that this may have to do with the framework...

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Are compact framework applications usually this heavy?

    We don't talk about those things....




    Actually, I haven't really gone looking at memory usage for PDA apps. I would not be a all surprised to find that it was the CF.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Are compact framework applications usually this heavy?

    Sounds fair... I've managed to 'stabilize' my app at 500K but it won't go any lower than that.

  5. #5
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [Resolved] Are compact framework applications usually this heavy?

    Quote Originally Posted by mendhak
    ...I created a CAB for it (release build)....?
    Excuse me for venturing into the land of off-topic, but how the noodles did you create the CAB? I'm just starting out with the mobile development myself but cant seem to find how to create the CAB.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [Resolved] Are compact framework applications usually this heavy?

    I haven't written a portable in anything newer than 2003, but in that one there was an option on the build menu called Build CAB, with the icon of a yellow file cabinet. Newer versions of .NET may have moved the thing around, but you might find the same icon somewhere.
    My usual boring signature: Nothing

  7. #7
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [Resolved] Are compact framework applications usually this heavy?

    Ah yes, the wonderful compact framework. .Net applications on the desktop are very memory hungry as well but it's more evident in mobile solutions. The compact framework on mobile devices is a joke. CF 2.0 made memory much more efficient but it's still off the charts.

    The only decent way to build an application for a mobile device, in my opinion, is with native code such as C++ for Windows Mobile. Sure it's a pain but... well, it's Microsoft's fault.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  8. #8
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [Resolved] Are compact framework applications usually this heavy?

    Why is this memory thing such a problem? Are you multitasking on your PDA? Not very likely. The OS will swap whole programs out of memory as needed. None of my PDA apps have had any memory issues, despite being written for older hardware which had less memory.
    My usual boring signature: Nothing

  9. #9
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [Resolved] Are compact framework applications usually this heavy?

    Quote Originally Posted by Shaggy Hiker
    Why is this memory thing such a problem? Are you multitasking on your PDA? Not very likely. The OS will swap whole programs out of memory as needed. None of my PDA apps have had any memory issues, despite being written for older hardware which had less memory.
    PDAs continue to have memory issues. My last phone was an HTC 6800 and it only had 64MB of ram (about 54 actually usable and about 24 after the OS was loaded). With only 24MB of ram I really couldn't do anything and swapping is insanely slow. If I opened Internet Explorer then checked my e-mail it would start swapping like crazy.

    Memory is still a big problem on PDAs. If you take a look at the Xda Developers (the folks who can usually take a new version of Windows Mobile and rip it to work on a PDA 5 years old) many create proofs of concept with C# then migrate to unmanaged C++ due to memory and speed deficiencies.

    Also, many do multitask on their PDA / phone. I enjoy listening to music while sending an e-mail or a text message or even surfing the web. Multitasking is becoming very common on PDAs and phones.

    Windows Mobile isn't the best OS for memory efficiency.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  10. #10
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [Resolved] Are compact framework applications usually this heavy?

    Did you write any of the programs you mention? I don't have much control over other peoples software. All of my portable apps have a single form, and once they are up they are up. I suppose it could be an issue if I had a bunch of other heavy operations in the background, but I haven't encountered any issues with things like .NET TCP connections moving data in the background.
    My usual boring signature: Nothing

  11. #11
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [Resolved] Are compact framework applications usually this heavy?

    Quote Originally Posted by Shaggy Hiker
    Did you write any of the programs you mention? I don't have much control over other peoples software. All of my portable apps have a single form, and once they are up they are up. I suppose it could be an issue if I had a bunch of other heavy operations in the background, but I haven't encountered any issues with things like .NET TCP connections moving data in the background.
    The last application I wrote for Windows Mobile involved a SQL Lite database back-end that kept track of projects and a few other things. It was a beast in the memory usage so I ended up scrapping the project. Beyond that I've mostly been a user of managed and unmanaged applications.

    Don't get me wrong my application could have been inefficient but even creating a simple form I think takes too much memory for a mobile device.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  12. #12
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [Resolved] Are compact framework applications usually this heavy?

    Never create more than one form. Forms are too slow on mobiles, so you only want to incurr that cost once. I have a couple programs that make use of SQL Server CE databases, and do some fairly complex stuff. They have never been run with lots of other things going on at the same time, but I've never had any issue with them. Unfortunately, my current hardware is so meager that there really isn't anything I'd be able to run in the background to test multiple apps at any one time.
    My usual boring signature: Nothing

  13. #13
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: [Resolved] Are compact framework applications usually this heavy?

    Applications using many forms, SqlMobile etc are no problem if written correctly - honestly.

    We have many LOB applications out there written in .Net running on a daily basis, doing data collection etc without any problems. This has been the case from VS2003 and is still the case with VS2008. We had data collection s/ware that collected over 500,000 items, that was written using VS2003, bluetooth attached GPS and SqlCE2 which had no problems whatsoever.

    I am not saying .Net CF is without problems, but to suggest it is unusable is just plain wrong.

    Writing for CF takes more care and attention than writing for 'big' windows, but people are putting out systems on .Net CF on a daily basis without problems. You need to ensure you dispose of things when you have finished with them.

    There are profiling tools out there for free - maybe worth looking at in the future.
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  14. #14
    Member
    Join Date
    May 2001
    Posts
    50

    Re: [Resolved] Are compact framework applications usually this heavy?

    Quote Originally Posted by Atheist
    Excuse me for venturing into the land of off-topic, but how the noodles did you create the CAB?
    IIRC you have to add a "CAB Project" to your solution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width