开发者

Flexibility of page file on Windows x64

When developing a Windows application for x64, then the user address space on Windows Vista and Windows 7 x64 is 8TB.

Let's say that I have an application which consumes significantly less than available physical memory (500MB-1GB) in normal working set, and in addition, I have much more than that (let's say 3GB-4GB) in distinct chunks (much smaller than the remaining memory size- let's say 100MB) which are to be loaded exclusively. Of course, whilst technically, I could easily fit an extra 4GB in the address space, the reality is that most of it would have to be paged, except on the higher-end computers which have 6-8GB of RAM.

The question is, 开发者_如何学运维am I going to destroy the computer's performance by exhausting the page file by consuming very large amounts of page memory for a single application? Or, equivalently, what would be an appropriate maximum for the amount of memory that I can put into page file?

In addition, would this actually increase my performance on the higher end of machines, as opposed to just loading the data manually from the associated files at the appropriate time?


If your distinct chunks are already stored as files, then treat them as memory mapped files. By doing so, your application doesn't have to manage reading / writing the data. Furthermore (and germane to your question), the data is backed by your files on disk and not the system's page file.

It is up to the operating system to manage the system's resources. Current page files are usually only constrained by available disk space. The OS will manage the system's performance by balancing the physical allocations given to each process. Physical memory allocation and not page file use is more likely to cause performance issues in other running applications.

You may consider providing a setting to toggle how much memory your application will use in case any customers see adverse performance effects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜