Hi,
I have a c# program which is working with .netcf3.5 on wince6.0 with 256M Ram.
The program is very large and cannot successfully run. It seems to be some kind of problem about memory. So I tried to simplify the situation and got the following result:
I use vs2008 to create a smart device project and place a button on the Form1 and then click "View Code". I just try to allocate 32MB of memory before InitializeComponent() as below:
public partial class Form1 : Form
{
public Form1()
{
byte[] data = new byte[1048576 * 32];
InitializeComponent();
}
}
After running it, an error message "Application encountered a serious error and must shut down!" appears.
if I set break point on the line of "InitializeComponent();", the error appears after stepping over.
If not, it appears after I pressing the OK button on the upper right of Form1.
Even I move the allocation line back before the line "Application.Run(new Form1());", same thing!
If I change to allocate 32MB after the line of "InitializeComponent();", it works fine.
My problem is, since my platform has so large of free memory, why the simple program cannot run? Is there something about .NetCf3.5 memory rule that I don't know?
Are there any ideas available to me?
thanks in advance,
Cameron DuffyPosted Aug 27, 2013, 9:16 PM
JerryPosted Oct 30, 2011, 9:20 PM
1. Upgrade .netcf from 2.0 to 3.5 and thus my app runs smoothly only if not via debugging tool.
2. After that, I never debug my apps using large memory via debugging tool as possible as I can.
Good luck to you!
Walter BoydPosted Oct 26, 2011, 4:19 PM
JerryPosted Jun 7, 2011, 2:39 AM
Actually, I also tried this simple project on windows ce 6.0 emulator on desktop pc,
but the result is the same.
And one thing I'd like to mention is that I meet this problem while debugging through Tcp/IP connection. If I execute it directly on device without debugging connection, it works fine.
I also check the memory tab on system properties dialog, the memory usage is as I expected.
Suthish NairPosted Jun 7, 2011, 1:40 AM