Memory Usage

G

Guest

Hi All,

I have a C# application that uses an SQL Server CE database and I am a
little confused about the memory usage of my application.
When I start the application the Control Panel -> Memory display shows that
7MB was consumed, but when I use the Performance Monitor (MSCOREE.STAT) it
shows a Byte Allocation of 2 MB.
This all came up because I have an h2200 that was showing Control panel
memory usage of 2MB, and a h5500 that showed a memory usage of 7MB. I am
confused.
BTW. My DB is 3.5MB in size.

Can anyone explain for me.

Thanks,
James.
 
D

Daniel Moth

mscoree.stat will show you the managed bytes your app allocated whereas
control panel shows you the total memory consumed by the process (inc CLR
etc). In my experience you can get that 7MB down but your app will slow down
(more GCs). Try for example, before launching your app, moving the slider to
under 7MB and then launch it to see if it complains.

Also note that the same info (managed memory use and total memory use) can
be deduced by using GC.GetTotalMemory and pinvoking the GlobalMemoryStatus
API.


Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top