D
Daniel Moth
Hi
Hopefully someone can help me clarify some memory issues and in particular
the difference between GetTotalMemory & GlobalMemoryStatus...
Apparently GetTotalMemory(false) retrieves the number of bytes currently
thought to be allocated. I assume the bytes returned reflect only the
managed bytes(objects) that *my* managed code has allocated, is that
correct? In other words if I have PInvoke calls that allocate memory that
would not be included, right? Is there anything else GetTotalMemory excludes
that one would assume is included?
I observe a large difference between what GetTotalMemory returns and what
GlobalMemoryStatus reports (taking in account the memory used by the system.
No other apps running). I am guessing this is because the GlobalMemoryStatus
includes the JITed code as used memory whereas GetTotalMemory doesn't; is
that correct? Still the discrepancy is large so there must be other factors
that I am not aware of... For example when GetTotalMemory returns 446KB
GlobalMemoryStatus (or indeed the memory control panel or even the remote
system info from eVC) shows 9072KB. What extra bytes is it including?
It seems even the simplest CF app (8KB exe) consumes over 1MB of memory. Is
that right or is there some flaw in my approach? Also GC.Collect affect the
results of GetTotalMemory but not the results of GlobalMemoryStatus... is
that in line with your observations?
Note that when the above results are observed, I then leave the unit/app
running for at least 1 hour (in idle mode) and the results remain the
same... I have also used the slider to effectively force a memory load of
over 95%...
Cheers
Daniel
Hopefully someone can help me clarify some memory issues and in particular
the difference between GetTotalMemory & GlobalMemoryStatus...
Apparently GetTotalMemory(false) retrieves the number of bytes currently
thought to be allocated. I assume the bytes returned reflect only the
managed bytes(objects) that *my* managed code has allocated, is that
correct? In other words if I have PInvoke calls that allocate memory that
would not be included, right? Is there anything else GetTotalMemory excludes
that one would assume is included?
I observe a large difference between what GetTotalMemory returns and what
GlobalMemoryStatus reports (taking in account the memory used by the system.
No other apps running). I am guessing this is because the GlobalMemoryStatus
includes the JITed code as used memory whereas GetTotalMemory doesn't; is
that correct? Still the discrepancy is large so there must be other factors
that I am not aware of... For example when GetTotalMemory returns 446KB
GlobalMemoryStatus (or indeed the memory control panel or even the remote
system info from eVC) shows 9072KB. What extra bytes is it including?
It seems even the simplest CF app (8KB exe) consumes over 1MB of memory. Is
that right or is there some flaw in my approach? Also GC.Collect affect the
results of GetTotalMemory but not the results of GlobalMemoryStatus... is
that in line with your observations?
Note that when the above results are observed, I then leave the unit/app
running for at least 1 hour (in idle mode) and the results remain the
same... I have also used the slider to effectively force a memory load of
over 95%...
Cheers
Daniel