Re: Small C# program takes up too much memory



"Chris Mullins [MVP]" <cmullins@xxxxxxxxx> wrote in message news:%23Wk1%237TVHHA.4764@xxxxxxxxxxxxxxxxxxxxxxx
<elty123@xxxxxxxxx> wrote in message:
I have a small C# program (about 400 lines of code) that is only 28kb
after compiled.

However when it runs (takes a whole 5 seconds) it takes up nearly 20MB
of memory and I don't see why.

[...]

Is there anyway I can reduce the memory usage?

This is a pretty common problem. Fortunatly there's a pretty easy solution:

http://www.coversant.net/dotnetnuke/Default.aspx?tabid=88&EntryID=4

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins




Chris,
you don't want your applications to run under an administrator account just to fake low memory consumption do you?
Note that doing this is much worse than calling GC.Collect in .NET, all it does is disturb the OSses BalanceSet Manager without any benefit for the user.

Willy.



.



Relevant Pages

  • Re: what is the best datatype for..
    ... visual window through, and have the user enter the values. ... Chris Mullins ... You could even pretend it's a game for the user to test his memory:P. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Memory footprint differences between x86 and x64
    ... "Chris Mullins" schrieb im Newsbeitrag ... In the course of some recent testing, I jotted down the numbers for both x86 and x64 with a very reproducable use case. ... I ran my tests on a dual-core AMD Athlon with 4GB of memory running Windows XP 64. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Small C# program takes up too much memory
    ... of memory and I don't see why. ... Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: can RAM capacity be expanded?
    ... Access Memory with the same type. ... Crucial.com has a memory finder for branded computers, ... Try not to disturb the original stuff. ...
    (microsoft.public.windowsxp.general)