If you can not start your application at all then probbaly it is too big.
WM5.0 can load ~15MB of appliction dlls into memory.
If you experience problems after the applcation has started some tools may
be of help:
http://blogs.msdn.com/ce_base/archive/2006/01/11/511883.aspx
> Hi,
>
[quoted text clipped - 25 lines]
>
> Thanks
WM 5.0 no longer uses RAM for storage, instead RAM is only used as program
memory and flash is used for storage.
Thus there's no slider anymore and there's nothing to adjust - 100% of
available RAM is program memory already.
Note all devices have 32MB virtual memory limit. Even if you have plenty of
free program memory, you can run out of virtual memory.
Typical example of that would be an attempt to load "small" 4-5 MB JPEG
file. Once uncompressed, it increases 5-10-20 times, easily taking out all
available virtual memory.
Another reason for "Out of memory" exception would be not disposing of used
objects properly. Basically whatever object has Dispose() on it - needs to
be disposed off.
If you don't, these objects would not be collected and would remain in
memory forever, so you would run out of virtual memory.

Signature
Best regards,
Ilya
This posting is provided "AS IS" with no warranties, and confers no rights.
*** Want to find answers instantly? Here's how... ***
1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactfra
mework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
> Hi,
>
[quoted text clipped - 25 lines]
>
> Thanks
First, your post is confusing. You say WM 5.0 and you say CE 5.0 - they're
not the same. I'm going to assume you mean a CE 5.0, non Windows Mobile
device.
> I'm working with a Windows CE 5.0 device. I get "Out of memory" errors
> but when I look at system memory from the control panel it shows free
[quoted text clipped - 3 lines]
> show the slider but on this Windows CE 5.0 device ( not a pocket pc) I
> do have a slider.
This indicates it's a generic CE 5.0 device. You can programmatically
adjust that slider (via SystemMemoryDivision)
> Also, on this device the slider does not adjust automatically as it
> does on previous versions of windows CE. If there is not enough program
> memory the slider does not automatically move to the left to take and
> use memory from the storage memory.
Non-Pocket PC devices have never done this unless the OEM made it do it.
> So I have 3 questions:
>
> On WM 5.0, will the OS automatically use memory from the storage area
> if it runs low on program memory and will the OS automatically use
> memory from the program memory if it runs low on storage memory?
On a WM 5.0 device, yes. For a CE 5.0 device, generally no.
> Is there a setting in platform builder to turn this automatic
> allocation on and off?
No, as it doesn't exist, you can't turn it off.
> Since I have a memory slider control on this device and it isn't
> automatically adjusting could this be causing the system to report an
> erroneous "Out of memory" error?
It's not erroneous. The system has a specific amount of RAM allocated for
use as program memory. Your app tried to alloc more than was available and
you got an exception. That's how the OS works.
-Chris
Jim - 18 Apr 2006 16:13 GMT
Chris
Thanks for the clarification. I did think that WM 5.0 and WIN CE 5.0
devices were the same OS.
Since they are not the same and my device is WIN CE 5.0, would it make
sense to programmatically set the slider for more program memory on
application startup? Currently the slider sits at 50%.
Also, Ilya (in a post above) memtioned that objects that dont get
disposed properly can eat-up virtual memory. Do you know of a good way
to test for this or a good tool to track down this type of problem of
objects that never get disposed?
Thanks - This helps a lot.
Paul G. Tobey [eMVP] - 18 Apr 2006 16:30 GMT
You can set the memory slider position in the config.bib file when you build
the OS, FSRAMPERCENT.
Not for managed code, but the Entrek TOOLBOX is a very good tool for finding
leaks in unmanaged code.
Paul T.
> Chris
>
[quoted text clipped - 11 lines]
>
> Thanks - This helps a lot.
Markus Humm - 20 Apr 2006 19:40 GMT
Paul G. Tobey [eMVP] schrieb:
> You can set the memory slider position in the config.bib file when you build
> the OS, FSRAMPERCENT.
>
> Not for managed code, but the Entrek TOOLBOX is a very good tool for finding
> leaks in unmanaged code.
Entrek will release one for managed code soon, but that can't tell you
what eats up the memory (what object types). But maybe I expect too much
out of it ;-)
Greetings
Markus
Jim - 18 Apr 2006 16:43 GMT
Chris,
Ilya,
Ilya, are you saying that objects with a Dispose method should always
have this method called; otherwise the object never gets released by
the garbage collector?
If so then would a good test to track down this problem be to keep a
running count of each instantiation of the object and each disposal of
the object then compare both running counts when the application exits?
I could create a log file entry for each constructor call and each
dispose call then check the log files to see if they match after the
application exits. Do you think this would work?
The code that I am working with is a bit odd in that it call the
GC.Collect programmatically each time a form is being drawn or
refreshed, not my design.
Thanks again