Log in

View Full Version : Windows Mobile and Memory Management - Why is it so Dysfunctional?


Jason Dunn
06-02-2005, 08:00 PM
Sometimes Windows Mobile devices embarrass me. :-( I have a consulting client using an XDA2 and it was in her purse and the record button got pressed (same old problem). I had forgotten to change the "only power button can turn the device on" because it had hard reset randomly on her a few weeks prior. So anyway, she had a voice recording that completely filled up the memory on her device. When a Windows Mobile device gets to where it has 50 KB of memory left, it completely falls apart. In her case, after she plugged it into power, it soft reset over and over (three times apparently), then hard reset. Then she calls me and asks why it happened. And what can I tell her?

It kills me that these devices are so fragile, that they have no software measures to free up memory. I've seen this scenario play out over and over where one thing or another, whether it's Notes, PIE, or something else fill up the memory, and there are no tools built into the OS to recognize that there's a low memory situation and do something about it. Why do we have a Disk Cleanup tool in Windows XP, where most of us have 60+ GB hard drives and rarely run out of space, but we lack something so vital on a device that has limited storage space? Equally as important, why doesn't Pocket Internet Explorer have an option to limit the cache size on the device? Why doesn't Notes have an option to keep "x MB memory free" and stop recording when the device starts to run out of memory? To my knowledge, there isn't a single Windows Mobile application that has any options for the preservation and management of memory on the device.

Why is there so little attention paid to memory management on these devices? That's a question I have no answer for.

Jerry Raia
06-03-2005, 12:14 AM
AMEN! Anything with so little memory should have been designed around the concept of memory management. The OS should take care of that before it does much of anything else. Of course we all know how MS can just leave things out. How many here remember that when NT 4.0 was released it had no defragmenter and none was made by any 3rd party for quite some time?

sojourner753
06-03-2005, 03:52 AM
You know Jason, I've been noticing that you've been publishing these kinds of articles on all three sites.

Don't get me wrong... they're all sort of those "I said it but you were thinking it" type of articles. And all pretty theraputic.

I just hope its not all getting to you. We're not going to lose you are we? 8O

Hang in there. We need you.

Jason Dunn
06-03-2005, 02:59 PM
I just hope its not all getting to you. We're not going to lose you are we? 8O Hang in there. We need you.

Don't worry, I'm not going anywhere, I'm just trying to bring to light what I feel are problems with the platform, because I want to see it improve.

lurch
06-03-2005, 03:32 PM
I'm just trying to bring to light what I feel are problems with the platform, because I want to see it improve.

Actually, from what you posted, it sounds like your issue is not with the platform but with the applications written for that platform. Windows CE could detect when memory is low, but what course of action should it take? How does it know exactly who is filling that memory that needs to be stopped? Especially since there is such a small separation between application memory space and storage memory space (and it can be changed dynamically). I do know that memory management was a HUGE consideration in the development of CE, so it's not fair to assume that at the platform level it was treated frivolously.

So from what you posted about your frustration with Notes, or Pocket IE, it really sounds like your beef is with application designers and not the platform.

Not that I really disagree with you about application memory handling, by the way :)

Jason Dunn
06-03-2005, 03:47 PM
So from what you posted about your frustration with Notes, or Pocket IE, it really sounds like your beef is with application designers and not the platform.

True, but Notes and Pocket IE are designed by Microsoft and part of the platform right? ;-) There's also a OS component here though insofar as the OS allows this to happen. :?

sojourner753
06-04-2005, 06:32 PM
So from what you posted about your frustration with Notes, or Pocket IE, it really sounds like your beef is with application designers and not the platform.

True, but Notes and Pocket IE are designed by Microsoft and part of the platform right? ;-) There's also a OS component here though insofar as the OS allows this to happen. :?

I certainly agree with that. I hold any OS about 90% responsible for memory managemen. If there is an offending program, then the OS should kill it not vice versa.

I may be convinced to reduce that percentage to 85% with a little reasonable debate.

lurch
06-07-2005, 02:29 PM
The OS is responsible for providing the facilities for memory management, and for managing the memory to a certain degree, but I was referring to situations like Jason's example: IE's cache fills up the memory which causes all other applications to begin acting funky (since they're all trying to run in a cramped space).

How on earth could that be the OS responsibility? The OS has already accomplished it's assigned task in that it reassigned program/storage allocations to allow IE to store whatever it was asking to store.

I can see it now... a windows mobile API call that is required before any memory allocation:
BOOL MemoryRequestRationale(LPWSTR lpszReason);
If the reason isn't approved, you're memory allocation is denied. :)

Mike Temporale
06-07-2005, 02:50 PM
I don't think the solution is to provide another API to the developers. ;) Instead, the OS could simply be triggered when available space is below a pre-set threshold. Once triggered all non-essential running applications will be halted, and the phone will alert the user that action needs to be taken. This would prevent any application from chewing up all the available memory.

I think this would be the best implementation, and it's something Windows Mobile should already have. IMHO. 8)