Re: 25 MB
From: Willy Denoyette [MVP] (willy.denoyette_at_pandora.be)
Date: 04/21/04
- Next message: Frank Lesser [LSW]: "Re: IL editor"
- Previous message: Anthony Yio: "Re: There are classes that mimic the old WinInet API?"
- In reply to: Thom Little: "Re: 25 MB"
- Next in thread: Sueffel: "Re: 25 MB"
- Messages sorted by: [ date ] [ thread ]
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.
>> > --
>> >
>> >
>> >
>>
>>
>
>
- Next message: Frank Lesser [LSW]: "Re: IL editor"
- Previous message: Anthony Yio: "Re: There are classes that mimic the old WinInet API?"
- In reply to: Thom Little: "Re: 25 MB"
- Next in thread: Sueffel: "Re: 25 MB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|