Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Doctor X said:whatever
Phoenix86 said:Now if I could make that happen on command, then test the same scenario with and without a PF, we would have our test.
GreNME said:No, because while a program accessing it might call it from the page file, there is no reliable way to force it to page completely.
GreNME said:First, how would you measure it?
GreNME said:Then, how are you going to force the process in a manner that can be recorded?
rcolbert said:but reiterate that XP alone doesn't have this requirement and there's no logical reason why an application 'should' care since it's not the application's job to manage virtual memory.
Hrmm... now this is looking more likely to happen.mikeblas said:Performance counters might work.
Or, you can use the tracing APIs; StartTrace() with EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS, then watch for EVENT_TRACE_TYPE_MM_HPF ... assuming it was physical page faults (and not any other kind) you were interested. Maybe you want EVEN_TRACE_TYPE_MM_COW, too.
mikeblas said:An application can lock pages into physical memory. In this way, it is "managing virtual memory". It can also, if written to do so, ask for memory in very specific ways that put strain on the memory manager.
Say you're playing an MP3 file. The codec has decompressed the MP3 into playable waveform data. It would be pretty crummy if the OS decided to swap those pages out just before they were played, right? So the application (or the driver) will lock them into physical memory.
Need another reason? Read the docs for the CreateFile() API, for example. If you're after performance, you're going to use FILE_FLAG_NO_BUFFERING. To get that to work the fastest, on all disk subsystems with all drivers, you need to make sure the memory you show the WriteFile() API is aligned.
How do you align it? One way is to request the allocation so that it is aligned at a specific logical address. This isn't "management", but it's darn close -- you're coaxing the manager to do something in a very intentional way.
It's easy to provide code that falls over on a machine that has no page file: just ask for all the physical memory, or ask for physical memory in a pattern that prevents other logical memory requests from being satisfiable.
With this information, I hope that you see there are reasons, and good ones -- quite common ones, why an application does have a reason to care about carefully managing, or at the very least strongly influencing, virtual memory.
rcolbert said:The examples where the application would fail on the other hand are cases where applications probably "should" not be written to do such things,
Most of what you are saying are examples of why memory would NOT be swapped to the pagefile.
Phoenix86 said:I figured out the best way to monitor the PF. This would be pretty tricky for any other file other than the PF, however perfmon has the perfect counters for this. First here's a good link explaining the counters in perfmon.
Phoenix86 said:Does this mean some people don't see benefits from disabling the PF? No. Does it mean everyone with plenty of RAM should disable the PF? Not from what I'm seeing so far.
The counter is limited to hard faults, and until someone shows me another file that recieves pages, that describes only pagefile.sys.mikeblas said:Thing is, the counter you mention monitors paging, not the page file. Paging can happen against files other than the paging file.
You don't describe what you did to the systems specifically to stimulate them while monitoring their paging, or what "various memory usages" could possibly mean. But I would expect the in-page operations you're seeing are pages faulting in from executable images.
When you ask Windows to load a program, it maps the image to memory. This means that the size of the image is reserved in memory, then the reserved memory is backed by the executable image. Windows loads the page with the image's entry point on it, then resolves all the fixups and so on. This leaves an amount of memory equal to the size of the image reserved, but with only a few pages actually loaded from the image and committed in memory.
Windows then calls the executable's entry point. As the code inside the image starts running, it ends up touching pages for read-only data, resources, and code in that image. The first time each page is referenced, it will cause a page fault. The OS will load the page from the image, and that action causes a read fault to show up on the performance counter even though the read isn't from the page file.
That's basicaly my findings, except in certian cases where it's really not worth it otherwise.I would agree. I think another way to think about it is this: people who are saying that disabling the page file when there's lots of RAM are assuming that Windows swaps to the page file when it doesn't actually need to. Disabling the page file causes Windows to be unable to sawp, eliminating the preceived unnecessary swaps. Thing is, there really aren't any unnecessary page file hits, so the suggestion of disabling the PF to avoid those hits is a fallacy.
Phoenix86 said:The counter is limited to hard faults, and until someone shows me another file that recieves pages, that describes only pagefile.sys.
Phoenix86 said:I have heard the "claim" that windows will always use a page file, even if pagefile is disabled. I don't recongonize anything you have said about this, so here's my standard response.
Phoenix86 said:in my opinion, too much.