CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Memory Limit Compact Framework WM6

  1. #1
    Join Date
    Dec 2008
    Posts
    5

    Question Memory Limit Compact Framework WM6

    Hello,


    I`ve been looking for the memory limit of the Compact Framework (2.0 and upper versions) on the WinCE 6. but all what i could found was the limit for the normal process which was 1gb.
    I`m asking because, CF was designed to run under the 32MB restriction that WinCE 5 had. Did they changed this behavior for WinCE 6? Or still the same thing?


    best regards.

  2. #2
    Join Date
    May 2004
    Location
    Osijek
    Posts
    61

    Re: Memory Limit Compact Framework WM6

    CF 2.0 will know how to use additional memory. However, during design of it, almost anything that uses much memory was thrown out. On WinCE 6, you would be able to allocate more memory for your structures, but CF itself will not use memory for its optimizations.

    CF 3.5 is different story since it uses memory in order to speed things up. It will know how to use all memory available to it. That is also why even 2.0 applications work faster with it (e.g. it caches virtual functions instead of searching for them every time).

    In short, CF 2.0 on WinCE 6 will not limit you to 32 MB.

  3. #3
    Join Date
    Dec 2008
    Posts
    5

    Re: Memory Limit Compact Framework WM6

    thanks for the reply!

    i`ve done a application (alot of bitmap processing and huge images to render) that used to run under WinCE 5 and CF 2.0, but i got alot of OutOfMemory exceptions. when i used the same app (without even rebuilding) on WinCE 6, the same behavior happened.

    should i rebuilt the app with CF 3.5 and targeting WinCE 6?


    best regards.

  4. #4
    Join Date
    May 2004
    Location
    Osijek
    Posts
    61

    Re: Memory Limit Compact Framework WM6

    How much memory is your application using? Remember that there is no virtual memory on WinCE devices. If you have e.g. 30 MB free, than 30 MB is your limit. Also notice that memory can get fragmented so allocating huge chunks of memory may not work also (e.g. although you have 20 MB free, allocating 10 MB will fail).

    Switching to 3.5 would be good since there are some speed optimizations. GC is also changed, so your program may work. However, I have my doubts.

    CF is just normal process. If platform has maximum of 1GB, CF has also maximum of 1GB. Out of memory gets thrown when its alloc fails and that is if there is not enough CONTINOUS memory space available.

    Try to "recycle" your objects (e.g. do not release bitmap but reuse it for other pictures of same size) as much as possible. Your footprint will increase, but memory fragmentation will decrease.

  5. #5
    Join Date
    Dec 2008
    Posts
    5

    Re: Memory Limit Compact Framework WM6

    both hardwares have 256MB, with 128 for storage and 128 for program execution. the app has 640x480px skinned forms, and starts with about 20MB. seems right for me to crash under WinCE5 because of the process memory limit. but not sure why it happens on WinCE6.

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)