52K exe file and 11MB memory footprint

C

Christofer Dutz

Hi,

First of all sorry for crossposing this question. I just found out that
this place fits much more than microsoft.public.dotnet.framework

I am playing around a little with C# and the .Net Framework. After
finishing a first application I have a 52K executable. When executing it
I can see that it has a memory usage of allmost 11MB. I guess this is
because of the .Net VM runing. Can I reduce the memory usage somehow?

Thanx in advance,
Chris
 
J

John Wood

This was discussed a few days ago...
Keep in mind a lot of that memory is shared between programs running the
CLR.

You should find that minimizing and restoring your app reduces the
footprint. You can do this programmatically with a Win32 API call: Call the
SetProcessWorkingSetSizeEx API function, passing in -1 for the
dwMinimumWorkingSetSize and -1 for the dwMaximumWorkingSetSize parameters.
 
M

Morten Wennevik

Hi Christofer,

I'm not sure exactly why, but running ngen on the executable (compiling it
to native code) seems to cause it to use less memory.

Happy coding!
Morten Wennevik [C# MVP]
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

I believe that the simplest win app use around that amount of memory.,

It's not only because the VM, but it's because the objects that you use, in
the 52K is the code for create for example X numbers of Label objects that
use Y amount of memory.

I don;t think you can reduce the memory usage much more than that.

Cheers,
 

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