Re: IIS (W3WP,EXE) by Pat
Pat
Mon May 24 00:52:28 CDT 2004
Are you specifying MEM_COMMIT in the VirtualAlloc call or just MEM_RESERVE?
Are you experiencing Hard or Soft page faults? A soft page fault is the OS
pulling from the lookaside lists (i.e. memory that the Memory Manager has
marked as available, but has not yet released to the system, so they are
relatively cheap). Obviously, not incurring a page fault at all would be
better.
The SetProcessWorkingSetSize requires either Admin or Power Users ACLs (See
MSDN for specific privileges). I don't believe that W3WP.exe will (by
default) fall into one of those categories. You should call GetLastError()
and see if the call succeeded. Also, so long as there is little or no other
pressure on the system, the OS will allow the Working Set to grow. If the
system comes under pressure, then trimming will begin (this API just
attempts to limit the trimming).
Finally, you might also want to check into creating a
CreateMemoryResourceNotification event. It basically allows for your
process to listen for notifications that the OS will send out when resources
get low so that you can release some back for system health.
Pat
When you virtual alloc (even when you lock), the OS does not immediately
back all of the memory (this is for perf reasons). What you would need to
do is 'touch' every page at least once, which will get the memory to be
backed by the OS.
"Greg" <anonymous@discussions.microsoft.com> wrote in message
news:5D5A1CD5-A355-4780-90A8-3974EFCC9D11@microsoft.com...
> I've built a web application to display very large images that experiences
heavy load. It is a .NET application the calls a c++ layer to talk to our
image sdk's. I VirtualAlloc (& lock) 500MB in the c++ dll and reuse this
memory over and over. Each of our Webservers has 2GIG of memory and the
WebApplication is the only program of merit that would be running.
Generally, the virtual memory (of W3WP) stays aroung 1GIG; however, the
working set of W3WP always seems to stay around 100MB and we are
experiencing high page faults - I'm calling SetProcessWorkingSetSize in the
c++ dll on initializaion and setting a minimum of 500MB and a max of 1GIG,
but these values never take (perhaps the call is failing with security
problems).
>
> I'd appreciate any help you can offer.