Re: memory usage minimized
- From: "Chris Mullins [MVP]" <cmullins@xxxxxxxxx>
- Date: Mon, 7 May 2007 16:43:29 -0700
"Alvin Bruney [MVP]" <some guy without an email address> wrote:
how do u trim ur working set at strategic times?
We know the areas that tend to dramatically expand the working set size, so
we trim it just after those events. For example (this is for an Instant
Messaging Client):
- After login (or logout) is complete
- After we create a new Chat Form (aka: Tab Page)
- When a Tab Page is Closed (aka: a Conversation is closed)
- When the user changes options or settings
- When the user hits "Clear All" in a Chat Window
There are a few other areas, but these are the big ones. In general, we
attempt to shink the working set after we do events that we expect to have a
signifigant impact on it.
With these calls in there, the application tends to hover (in the Task
Manager, which is the only thing that matters) around 10 to 20 megabytes of
memory. If we're really agressive about things (using a timer etc) we can
get it lower, but there is then a noticable impact on application
performance.
If we remove these calls completly, after the app has been running for 4 or
5 hours (it's an IM client, remember, so it runs all day long on the
desktop) the memory usage hovers in the 200 to 300 megabyte range, and will
sometimes go higher.
... and before you ask, we're not leaking memory. The application has been
profiled a number of times with both performance and memory profilers and
things look pretty good.
The interaction between .Net WinForms applications and the Win32 Memory
Manager seems (to me) one of the weakest areas of the overall platform. Any
signifigant (any many insignifigant) application ends up taking hundreds and
hundreds of megabytes of memory, even though they're not doing anything with
it. This is frustrating for developers and users alike, and just plain
shouldn't be happening on a platform as mature as this.
--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins
.
- Follow-Ups:
- Re: memory usage minimized
- From: Ben Voigt
- Re: memory usage minimized
- From: Alvin Bruney [MVP]
- Re: memory usage minimized
- References:
- Re: memory usage minimized
- From: Chris Mullins [MVP]
- Re: memory usage minimized
- From: Alvin Bruney [MVP]
- Re: memory usage minimized
- Prev by Date: Re: memory usage minimized
- Next by Date: Re: memory usage minimized
- Previous by thread: Re: memory usage minimized
- Next by thread: Re: memory usage minimized
- Index(es):
Relevant Pages
|
Loading