TweakHomePC

Dual-booting all versions of Windows and Linux

   Dual-Boot    |    Win 8    |    Win 7    |    Vista    |    Win XP/2K/NT    |    Win9x/Me    |    How to    |    Legacy 9x Tweaks    |    SiteMap   


 

Here: Home > Legacy 9x Tweaks > Memory Tweaks >


WALIGN WINALIGN WMALIGN

ADVANCED USERS ONLY

Would you like programs like Netscape, Media Player, Photoshop, or other large programs to load substantially faster? You can, by 'aligning' them.

Pre-aligning them into 4KB block on the Hard Disk allows them to load into memory much faster.

You must have Office installed to run these utilities, but there may be a way around that limitation.

WHAT IS ALIGNing?       Advanced Users

Aligned programs are stored in 4KB blocks of data on the HD

Windows handles internal memory in specific chunk sizes (4KB) called Pages. Non-aligned applications are not stored (on the Hard Disk) in these chunk sizes and therein lies a problem. The non-aligned have to be 'made to fit' into memory's 4KB Pages.

MapCache is the in-built Win98 program that moves applications in and out of memory areas. In the case of non-aligned programs it has to fit (to "map") the code from your Hard Drive into the memory Page structure that Windows requires - so that each segment starts on a 4K boundary. The 'mapping' takes some noticeable time in the case of large applications.

Obviously, if your larger programs on the Hard Disk are already pre-aligned, they would load faster and use less memory. And they ARE faster.

Most of the code in Win98 is already aligned (the core OS components and applets, for instance). However, all the CD's third-party applications are probably unaligned and the larger ones should benefit from being aligned.

Only the executable files (.exe and .dll) must be aligned and care must be taken not to align certain types (more later). Over the next few years most new applications can be expected to come pre-aligned. However, until then, there are plenty of large applications out there that will benefit substantially. Aligning small programs is simply not worthwhile and increases the risk of encountering a problem.


ALIGNING UTILITIES        Advanced Users

WMAlign appears to be superior

WAlign is the built-in program 'aligner' utility that comes with Win98+.
It is for Office components only

WinAlign is a more powerful version and can align just about any application. It comes with the full Win98 Resource Kit (for about $70).

WMAlign does much the same as WinAlign and is free from Windows Magazine (read the instructions carefully)

You must have Microsoft Office installed to run these utilities. Windows Magazine was working on a fix for their WMAlign but WinMag no longer exists! Pity!

However, its claimed that adding the following registry Key will make it run:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Office8.0
An empty default entry is said to be sufficient. This has not been verified by THPC, though that Key does exist on systems using Office/WinAlign. You can download the file Wmalign8.zip (219 bytes, freeware) from THPC (double-clicking Wmalign8.reg installs the Office8.0 Key in the Registry).

get it here WMAlign.zip (freeware, 3KB Zip file, requires MS Office installed, or first use Wmalign8.zip)


WHAT PROGRAMS SHOULD I ALIGN ?        Advanced Users

Try aligning any large program you often run, especially if it loads slowly.

Do not bother aligning smaller programs.

Do NOT align these program types:

CMP's TechWeb says:
" In particular, the following types of programs should not be aligned: virus checkers, NT system files, cryptographically signed executables, self-extracting EXE files, programs that perform cyclic redundancy checks on themselves and programs that use the EXE file to store configuration data. Instead, concentrate on the apps you run frequently and those with long launch times. "

You likely have only a small number of large slow-loading programs that need aligning. Just align one at a time and run it for a week or two before aligning the next. Defrag weekly.

WMAlign has the best 'remove alignment' feature (more later). It is said that WAlign's and WinAlign's efforts to undo the alignment do not always work!


IS A PROGRAM ALREADY ALIGNED?        Advanced Users

Checking a programs current alignment:

You will need to check whether or not a program is already aligned.

1. Locate the .EXE or .DLL file you want to check

2. Right-click on it and select Quick View (you have Quick View installed, haven't you?)

3. You should see the words Windows Executable or Dynamic Link Library at the top

4. Locate the Image Optional Header section

5. Locate Section Alignment and File Alignment

6. The values will be 1000 if the file has been aligned already
    (that 1000 is the Hexadecimal equivalent of 4096 in decimal, or 4KB - the aligned size)


As an alternative to the above:

You may have a text file, WinAlign Report.txt, in the Windows\System directory which should have a list of the successfully aligned files.


USING WMALIGN        Advanced Users

Aligning with WMAlign:

WMAlign is basically a batch file that coaxes WAlign to work with non-Office programs.
1. Go to a Command prompt
2. Switch (use the CD command) to the program's Directory (with the executable files)
3. Type wmalign *.exe *.dll to align all the executable files in that directory
4. Defragment after running the prog a few times, and then weekly (Defrag must 're-learn')
5. Later: Re-align again after any change to the executables e.g. installation of an update
    Note 1: for best performances align both the .exe and .dll files
    Note 2: the log file wmalign.txt is created in that same Directory

Removing WMAlign alignment:

You can easily remove the alignment should a program become erratic, or perhaps not work.

WMAlign utility keeps a backup of all the files it aligned in an Unalign subdirectory, located in the aligned program's directory.
1. Close the program involved
2. Copy the original files from the correct subdirectory over the unsuccessfully aligned ones
3. Do not delete the backup until you a certain the alignment is working properly or you would have to fully uninstal/reinstall the full program


USING WINALIGN        Advanced Users

Aligning with WinAlign:

WinAlign (winalign.exe) is installed with Win98's Resousce Kit in the PowerToy subdirectory.

Unfortunately you can not use it from a Command prompt there, so you can move it (winalign.exe) into Windows\Command.

Removing WinAlign alignment:

The WinAlign utility does not backup the original non-aligned files.

It keeps some information about the original alignment in Registry keys at:
HKEY_LOCAL_MACHINE \Software \Microsoft \Windows \Current Version \WinAlign

The -r option (type WinAlign -r on the command line) is used to restore the previous alignment - it uses that Registry information to modify the aligned file. Apparently it does not always work satisfactorily and an application reinstallation may be necessary (or did you back it up first?).

[top of page]

Please remember that you alone are responsible for the consequences of any changes you make to your computer hardware or software.

Copyright © LarryM 1998-2015 thpc@mail.com