Re: Small C# program takes up too much memory



While I agree with you 100% on every technical level, the user's perception
defines reality. Users see the big number in task manager and get cranky.
They see a small number, they're happy.

I really wish I had a better answer. For almost all the small client-side
stuff we do, this works well. Especially as these apps load, and don't
really do anything. They're doing almost no processing, no data base stuff -
they're just sitting idle and reporting that they're taking 20-50 megs of
memory.

Running GC.Collect over & over doesn't even solve the problem - the app
still reports a huge amount of memory, and the users perception then is that
we suck.

Please - give me a better solution! :)

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

"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:eD7ki6dVHHA.3652@xxxxxxxxxxxxxxxxxxxxxxx
"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: CFont memory leak !?
    ... your leak is somewhere else. ... the memory will NOT increase... ... I think you are being misled by what task manager is telling you. ... on my MVP Tips site. ...
    (microsoft.public.vc.mfc)
  • Re: CFont memory leak !?
    ... the memory will NOT increase... ... but if the nPointSize is changed in a big wide range continuously, ... I think you are being misled by what task manager is telling you. ... on my MVP Tips site. ...
    (microsoft.public.vc.mfc)
  • Re: Memory usage of my application
    ... leaks also very less. ... But In task manager my application is eating too much of memory usage. ... I wouldn't trust task manager numbers of memory size for anything I cared about. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Using CSocket with CSocketFile Increases memory usage
    ... CSocket is known to be buggy, ... application for 6 hours the memory increases in Task Manager by ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: UNABLE to run EXPLORER.EXE
    ... task manager, the registry ... file is reloaded into memory. ... my registry with ERUNT. ... the task manager and navigate ...
    (microsoft.public.windowsxp.general)