Memory problems with Compact Framework

  • Thread starter Thread starter simone.51
  • Start date Start date
S

simone.51

Hello!

I'm working on an application that using a lot of memory on PocketPc.
It seems that it almost uses the 32Mb of available memory.

I tried to trace the behavior of physical memory and virtual memory
using MemoryManagement.AvailablePhysicalMemory and
MemoryManagement.AvailableVirtualMemory.

At startup :
AvailablePhysicalMemory : 33 076 Kb
AvailableVirtualMemory : 1 728 Kb

I use the application, and as I go along, these values decrease.
Moreover, when AvailableVirtualMemory is close to 0 Kb it increases up
to 512 Kb and decreases all the time and it produce importants lags.

How works these two kind of memory on CompactFramework?
Did you encounter same problem?

Thanks you.

Best regards.
Eric.
 
The "lag" you see is very likely garbage collection being forced by an OOM
internally. The fact you have nearly no virtual memory is going to be a
major problem for performance. I'd consider reworking the apps in whatever
way you can to release some of that.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Thanks for your answer!
We actually use OpenNetCF :)

We already have problem for performance!
So, I still have some questions on the use of these two kind of memory
(virtual and physical)
I use the GlobalMemoryStatus function ( DllImport("coredll.dll") ). Is
the AvailableVirtual corresponds to the available memory which would
be used by the application process?
What's about Available Physical?

Thanks.

Best regards
Eric
 
Back
Top