Re: Performance problem with UnmapViewOfFile() in Vista and XP x64
- From: chaboud <msdnnews.mlc@xxxxxxxxxxx>
- Date: Tue, 6 Mar 2007 12:40:00 -0800
I tried this with the LH Feb '07 CTP, and that did not correct the problem.
If this is roughly the state that the kernel will be in for Vista SP1, we'll
have to find a workaround, feature limitation for Vista, or, at the very
least, warn our users about the issue.
In the context in which we use this technique (an HD video editor) we can
see a significant performance loss, from 20fps playback in XP 32 to 5fps in
Vista 32 on the same hardware. Because of virtual-address-space size-limits
and fragmentation, it is not possible to avoid unmapping without severely
limiting the amount of usable memory for these buffers. Limiting this cache
size would lead to a performance/usability limitation, so any such change
would have to be restricted to Vista.
We'd very much like to find a clean resolution to this if at all possible.
Thanks again for your help,
Matt
"Pavel Lebedinsky [MSFT]" wrote:
There have been some changes in Longhorn Server and Vista SP1.
to reduce flushing of modified pages in cases such as the one you
describe. If you have access to LH beta builds you can try the
latest (February 2007) CTP available from http://connect.microsoft.com
to see if it makes a difference.
I will also try your program here. How much RAM does your system
have?
--
This posting is provided "AS IS" with no warranties, and confers no
rights.
"chaboud" wrote:
I've been working on a performance problem that has shown up in Vista and
XP
x64.
When using CreateFileMapping() and MapViewOfFile() with an
INVALID_FILE_HANDLE to use a pagefile-backed mapping, XP 32 does not write
heavily to the disk to sync the modified pages to the backing store
(pagefile.sys) when UnmapViewOfFile() is called.
If the backing file is an *actual* file (i.e. not the pagefile), the data
is
written back to the file asynchronously, and a disk can get hit pretty
hard
(desired behavior).
In XP x64 and Vista, the system nails the pagefile-disk in the
INVALID_FILE_HANDLE case, which can be a serious performance issue when
moving roughly 256MB of data through file mappings per second. This will
lead to a sluggish system for quite some time after unmaps have ceased.
The following code demonstrates the problem. Run on XP 32, this code will
merely peg a core with near-nothing-work. Run on XP x64 or Vista(32 or
x64),
it will peg a core and a disk.
- Follow-Ups:
- Re: Performance problem with UnmapViewOfFile() in Vista and XP x64
- From: Pavel Lebedinsky [MSFT]
- Re: Performance problem with UnmapViewOfFile() in Vista and XP x64
- Prev by Date: Re: Unknown Process reading application memory
- Next by Date: Re: Unknown Process reading application memory
- Previous by thread: Map physical address in windows 98
- Next by thread: Re: Performance problem with UnmapViewOfFile() in Vista and XP x64
- Index(es):
Relevant Pages
|
Loading