Re: Small C# program takes up too much memory
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Wed, 21 Feb 2007 21:14:39 +0100
"Chris Mullins [MVP]" <cmullins@xxxxxxxxx> wrote in message news:O%23BD3teVHHA.1636@xxxxxxxxxxxxxxxxxxxxxxx
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.So you mean that:
- all of your users run with administrative privileges, and..
- as such, they know what "Memory Usage" ("Working Set" on Vista) really means or what "Private Bytes" is all about.
Why do they "get cranky" then?
If they don't know exactly what these counters are about, why are they looking at them and why do they "get cranky" then?
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.
I didn't say that GC.Collect was a solution, I said that both are bad, calling GC.Collect at regular basis disturbs the GC operations, applications that are reducing the WS disturbs the BalanceSet Managers normal operations and is even worse as the BSM is a global resource. In both cases let them do their job, both the GC and certainly the BSM know better than anyone else when they should run.
But again, this is not the real issue, you are forcing your users to run as full admins (a big NO NO per default on Vista) which makes them vulnerable to all sort of security attacks, this is what I call *reality*, tell them about this and let them make an educated choice.
Please - give me a better solution! :)
I don't see a problem (other than running as an administrator), so why asking for a solution :)
Willy.
--
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.
.
- Follow-Ups:
- Re: Small C# program takes up too much memory
- From: Chris Mullins [MVP]
- Re: Small C# program takes up too much memory
- References:
- Small C# program takes up too much memory
- From: elty123
- Re: Small C# program takes up too much memory
- From: Chris Mullins [MVP]
- Re: Small C# program takes up too much memory
- From: Willy Denoyette [MVP]
- Re: Small C# program takes up too much memory
- From: Chris Mullins [MVP]
- Small C# program takes up too much memory
- Prev by Date: Re: Convert directly from hex to signed short
- Next by Date: Having problem getting query executed in a DataSet
- Previous by thread: Re: Small C# program takes up too much memory
- Next by thread: Re: Small C# program takes up too much memory
- Index(es):
Relevant Pages
|