Re: Program memory usage in Windows CE 5.0

On Aug 12, 11:22 am, Rob <R...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Write a program that copies files periodically.
Check the remote tools to see if memory usage keeps increasing over time.
This also excludes explorer from your test.

If the mem-usage increase is just limited and does not keep increasing ,
there is no problem. Maybe youré looking for a problem that does not exist.


"embedinfo" wrote:
On Aug 11, 7:25 pm, embedinfo <embedi...@xxxxxxxxx> wrote:
On Aug 11, 5:44 am, "Michael Salamone" <mikesa#at#entrek#dot#com>

Does the memory usage grow with each operation or just the first one?

What file system do you have mounted as root?  Is it object store
(RAM-backed) or flash or ?

Michael Salamone, eMVP
Entrek Software,

"embedinfo" <embedi...@xxxxxxxxx> wrote in message


Hi there,

I have a question on Program memory usage in Windows CE 5.0. When I
copy a file from one location to another on the device I see incerase
in program memory usage. (For example from MyDocuments to Desktop).
But if I delete the same file from desktop and recycle bin, I don't
get back the memory allotted during the copy. Is this memory leak in
Windows CE 5.0 filesystem? If not why Windows CE behaves like this?
Who uses that memory? How to avoid this happening?

Any inputs will be helpful!

Thanks- Hide quoted text -

- Show quoted text -

Yes it grows for every operation (some times it increases by 12KB,
next time if you copy the same file it increases by 4 KB. The
increment is random), but it doesn't grow by file size. My platform
has flash memory and I have mounted flash disk as root and using hive
and ROM filesystem. Is there anyway I can avoid it?
This is critical issue. Any inputs will be really helpful!

Thanks- Hide quoted text -

- Show quoted text -


I am using FATFS. Similar behaviour is seen on Emulator platform as
well. Is this memory leak in filesystem? Some times I have seen that
usage of program memory increment stops also after copying the same
file several times (may be 3-4 times). But if I copy some other file
and delete again it increses.

I have set FRAMPERCENT= 128KB (minimum).

Steps to reproduce:
1) Build Emulator platform.
2) Check original Program memory usage using Control Panel-->System
2) Copy some file from Windows directory to desktop (copy a file more
than 10K size)
3) Observe the change in INUSE program memory.
4) delete the file. File will be moved to recycle bin. and observe the
memory status.
5) Delete the file from recycle bin as well and check the memory
status. It will not come to original state (I mean what you observe in
step 2)

Note: While I test this, I dont do any other operation.

Thanks- Hide quoted text -

- Show quoted text -


As per your suggestions I wrote simple application to copy move and
delete file, without opening explorer. Here is my program:

// FileCopyDelApp.cpp : Defines the entry point for the console

#include "stdafx.h"

int _tmain(int argc, TCHAR *argv[], TCHAR *envp[])

//Copy files from Temp directory to Desktop
RETAILMSG(1, (TEXT("\n Failed to copy the file error:

//Move the files to My Documents
if(!MoveFile(L"\\Windows\\Desktop\\test.mp3",L"\\My Documents\
RETAILMSG(1, (TEXT("\n Failed to copy the file error:

//Move files from My Documents back to Desktop
if(!MoveFile(L"\\My Documents\\test.mp3",L"\\Windows\\Desktop\
RETAILMSG(1, (TEXT("\n Failed to copy the file error:

//Delete the files
RETAILMSG(1, (TEXT("\n Failed to delete the file error:

return 0;

I have kept the the application on desktop and copied the test file to
Temp directory using activesync. Since I BSP supports presistent
storage, even I reboot my device files will be present. After
rebooting device i connected remote performance viewer to check memory
statistics and then started application and other than this I am not
running any application. And control panel --> system applet shows
following values. (I have opened control panel app before running the

I – Iteration (Executed application multiple times in each iteration)
In use Storage memory In use Program Memory
60 17164 kb
‘’ 17348
‘’ 17348 Kb
‘’ 17352 Kb
‘’ 17348 Kb
‘’ 17356 kb
‘’ 17356 kb
'’ 17360 Kb
‘’ 17364 Kb
‘’ 17364 Kb
‘’ 17368 Kb
‘’ 17368 Kb

II - Iteration
60 17160 Kb
‘’ 17340 kb
‘’ 17344 kb
‘’ 17348 Kb
‘’ 17352 Kb
‘’ 17352 Kb
‘’ 17360 Kb
‘’ 17364 kb

I observed that almost there is 200Kb of memory leak. I read in the
forum that Windows CE garbage collection is slow. But I observed that
in use program memory never comes back to original value (17160KB). I
would like to know the reason for this. If I do file copy deete
operations multiple times, program memory in use increases

is there any way i can fasten the Windows CE garbage collection? Any
inputs will be helpful!



Relevant Pages

  • Re: Growing memory usage in D4 app with SerialNG
    ... it must run on a Windows platform, usually a laptop, and the hardware that might use the RTS and CTS has a limited amount of memory for a buffer, and it would certainly overrun if it were asked to hold off transmission for any longer than a hundred mSec or so. ... But while it was easy to have an almost-realtime program run on DOS, one will have all kind of problems when the same is attempted on Windows. ... The initial memory usage shown when I minimize the application is 1100 kB, which is exactly what I would expect for those figures, but I don't know why it should keep climbing. ...
  • Re: Overhead of individual python apps
    ... This memory usage is as reported by the Windows Task manager ... reporting the total memory usage for each process, ...
  • Disabling the page file doesnt really disable it. A bug?
    ... the advanced tab of "My computer" properties. ... The total memory of all my processes ... no reason for windows to swap to a page file. ... For example the total memory usage of firefox with 60 tabs open is ...
  • Re: Memory usage, Task Manager versus Process Explorer
    ... >>claimed to be using a very small amount of memory. ... >>because the Windows Task Manager reports only about 350KB of its memory ... >>What's the minimum memory usage of a Windows program? ...
  • Re: Adjusting alogarithm
    ... that way It will use less memory. ... To confirm that memory usage is not the issue, ... In the Application tab, click on Excel, then right-click and click on GoTo. ... In the Process tab, be sure that you see columns labeled Mem Usage, Peak Mem Usage and VM Size. ...