Re: memory usage minimized



thanks

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley


"Chris Mullins [MVP]" <cmullins@xxxxxxxxx> wrote in message
news:OYm8CGQkHHA.5048@xxxxxxxxxxxxxxxxxxxxxxx
"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



.



Relevant Pages

  • Re: Hot plug vs. reliability
    ... >> the memory controller can be switched into a test mode, ... Probably it is platform dependent. ... for a 32 CPU "main frame". ...
    (Linux-Kernel)
  • Re: BBC lockup
    ... The number of services on the platform has been expanding at quite a rate. ... A mux operator, not the BBC, introduces a new service and this consumes some memory in the box and reduces the amount of memory available to other applications. ... So I believe the only real option is to go down the CH4 blocking route. ...
    (uk.tech.digital-tv)
  • Re: CPU load in wince 5.0
    ... are those build agains the SDK of your ... All application must build agains the correct SDK, because every platform is ... this via an API u can use the CreateToolhelp32Snapshot, Thread32First() ... If you mean the size of the USB Memory device then you ...
    (microsoft.public.windowsce.embedded)
  • Re: Virtual memory allocator recommendations?
    ... There is no way to portably write a storage allocator ... access to the OS memory management facilities. ... I don't want anything platform specific. ... or anything like that --- I want to be able to allocate chunks ...
    (comp.lang.c)
  • Re: how to get aliagned memory using malloc
    ... > Some told me that for memory to be aligned, the last 6 digits of the ... It depends on the internals of your platform. ... have restrictions on where certain data types may be placed, ... is why it is part of the implementation of a compiler. ...
    (comp.lang.c)

Loading