Re: 25 MB

From: Willy Denoyette [MVP] (willy.denoyette_at_pandora.be)
Date: 04/21/04


Date: Wed, 21 Apr 2004 13:31:05 +0200

Yes you can, using PInvoke as mikeb said and the FCL contains a class that
allows you to reduce the max. WS, but you shouldn't do it as there's no need
for it. Just let the OS do it's job, it knowns a lot more about what pages
are idle, and their age, not only your pages but all processe's pages in the
system. If you plan to trim your workingset be prepared to take a number of
hard pagefaults when your program jumps to a page you moved to the pagefile.

Willy.

"Thom Little" <thom@tlanet.net> wrote in message
news:%23q0ZzqyJEHA.3980@TK2MSFTNGP10.phx.gbl...
> Interesting ... and since I have 1GB of memory there is no contention and
> the trimming never occurred.
>
> Is there a way to induce the working set trimming after initialization in
> an
> environment where there is no external page contention?
>
> --
> -- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
> --
>
> "Willy Denoyette [MVP]" <willy.denoyette@pandora.be> wrote in message
> news:Oe1GPjyJEHA.2580@TK2MSFTNGP12.phx.gbl...
>> Even for a trivial Windows application the CLR and a lot of related
>> native
>> code libraries must be loaded, a bunch of assemblies loaded, a number of
>> application domains initialized, the GC heap reserved, System.WinForms
>> classes loaded and Jitted. That all means that the initial memory
> footprint
>> is high and certainly higher than non managed applications. Once the
>> appdomains are created, winforms is initialized etc... a lot of memory
> pages
>> are no longer (directly) needed.
>> However, these pages, are only returned to the OS when there is memory
>> pressure, when this happens the OS will trim the Working sets of the
> loaded
>> processes (managed or unmanaged), on XP and higher the OS will also
> requests
>> the managed applications to return unused pages to the OS.
>>
>> Willy.
>>
>> "Thom Little" <thom@tlanet.net> wrote in message
>> news:OHAb$RyJEHA.2884@TK2MSFTNGP12.phx.gbl...
>> >I finished a fairly trivial C# windows application. Task Manager
> reports
>> > that this application is 25 MB! Yes it is the release configuration.
>> >
>> > Any suggestions on how to investigate how this dinky application blew
>> > up
>> > into these humongous proportions?
>> >
>> > --
>> > -- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
>> > --
>> >
>> >
>> >
>>
>>
>
>



Relevant Pages

  • Re: 25 MB
    ... the trimming never occurred. ... Is there a way to induce the working set trimming after initialization in an ... That all means that the initial memory ... > is high and certainly higher than non managed applications. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Still confused why working set larger than virtual memory
    ... With the SysInternals Process Explorer the column is called Working Set. ... What you removed is exactly the "smart trick" to have memory "accessible", ... as you map views you never unmap. ... I attach my test source which I used for my file mapping measurements. ...
    (microsoft.public.vc.language)
  • Re: Binary data in multiple adjacent files
    ... Mapping it doesn't eat any working set except, possibly, for the ... It's not faulted into physical memory. ... You also get a whole "page fault cluster" faulted in. ... grid sections immediately north, south, northeast, northwest, southeast ...
    (comp.os.vms)
  • Re: Still confused why working set larger than virtual memory
    ... The next time I map the same part of the file, it still contains the same data I filled it before, demonstrating it resided somewhere (I also explained why I am sure they resided in the physical memory, not in the page file). ... This also exactly what Alexander Nickolov is talking about: even when you unmap your file views, the pages still may reside in the memory and may be a part of the working set. ... I am not freeing the memory, I am only unmapping its virtual addresses. ...
    (microsoft.public.vc.language)
  • Re: OT: Requesting C advice
    ... some behind the scenes action of the compiler. ... In fact the memory could ... Proper initialization means that floats and doubles must be initialized to 0.0 and pointers must be initialized to the null pointer value, even if those bit patterns differ from all-bits-zero. ...
    (Fedora)