Previous | Next

WinAlign and MapCache

WinAlign is a tool designed to optimize the performance of executable code (binaries) on the Windows 98 platform. WinAlign works by formatting the sections of binary files along 4 KB boundaries. Because pages on the Intel x86 chip family are 4 KB, this aligns the executable sections with the memory pages, increasing the efficiency of data caching.

Caution

WinAlign works by restructuring an executable’s files and can cause problems with certain applications. Such damage can usually be corrected by restoring the files to their previous condition (type WinAlign -r on the command line). In some cases, it may be necessary to reinstall the application.

MapCache is a performance feature that causes programs to consume less memory. Simply installing Windows 98 gives you some of the benefits of aligned binaries running directly from the cache, but to gain the most benefit from aligned binaries, you should run Winalign.exe. The alignment process takes less than one minute on an empty drive (with only Windows 98 installed), and should not take longer than five or six minutes on a full drive.

Memory can be divided into two parts: the disk cache (VCACHE) and memory that is allocated to run programs (VMM). The cache is useful because memory I/O is faster than disk I/O. For example, if you close Microsoft Word and then shortly afterwards restart Microsoft Word, much of the application is brought into VMM to run from the cache rather than having to be read off the disk. The result is a faster application start.

The downside of this process is that the cache takes up memory that could be used for other applications. You have two copies of some data in physical memory: one copy in the cache and another in VMM, which is being used to run the application. Having more memory available to VMM in many other cases than the application reload lets your system run faster, as it prevents over committing memory and writing/reading from the swap file (another case of slow disk I/O).

Memory mapped I/O out of cache is the best of both worlds. This process keeps a single copy of many pages of memory in one place rather than two places. This gives you more memory available for running applications, and, at the same time, less of the swap file is being used.

The WinAlign.exe file is located on the Windows 98 Resource Kit compact disc. For more information about WinAlign, see Microsoft Windows 98 Resource Kit Tools Help on the Windows 98 compact disc.