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 > Hard Disk Tweaks Center >


VIRTUAL MEMORY - SWAP FILE PAGING

Virtual Memory is an admirable and necessary Windows function but can hinder your computer performance!

When most of main memory (RAM) is in use, Windows uses an area of the hard disk (Virtual Memory) to store data it would normally leave in memory.

Moving this data out of memory is called Paging. The data is stored in a file (Win386.swp) called the Swap File and will be found, by default, in the Windows directory.

An overactive Hard Disk ('trashing') is caused by excessive use of Virtual Memory (VM) which itself results from a lack of 'available' free memory. Any use of Virtual Memory causes the PC to slow down. Adjusting the default VM setting can speed up its usage.

ConservativeSwapfileUsage=1 is included here.

Also read Startup and Vcache in the Memory section.

CORRECT VIRTUAL MEMORY SETTINGS      All users

Determine your VM requirements accurately

Windows' default (dynamic) method of handling virtual memory works well for two types of users:
- those who have far too little main memory, and
- those who run very memory intensive software, like voice recognition programs.
Everybody else will gain by using a static VM.

Recommendations of using 2½ times main memory for VM is not accurate enough!
VM's size needs to be set according to your own needs.

For most Home users it is convenient to use a safe and reliable utility such as Swap Monitor or Windows' own utility, System Monitor to estimate VM requirements. Either will help you decide on the settings best suited to your own usage.

• First set VM to "Let Windows manage my virtual memory settings".
• Run the utility
• Open all the programs you are likely to use at any one time - the utility will tell you the size of VM (or look at the size of Win386.swp in \Windows\).
• Add a little, say 10-20%, for future proofing. You now have a figure for your greatest VM needs.
• Now set VM manually (next). Most users find it best to use the same figure for both Maximum and Minimum (this prevents Windows using time to monitor/resize the Max/Min).

Get it SwapMon (shareware; v 1.50; 1,489Kb; swapfile and VCACHE manager)

[top of page]

TUNE VIRTUAL MEMORY       All users

Setting a static Virtual Memory

Defragmenting first is optional, but highly preferable.
• Boot to Safe Mode (CTRL or F8 during bootup). Switch your Screen Saver off.
• Right-click My Computer, and select • Properties • Performance • Virtual Memory.
• Select Disable Virtual Memory. Ignore that caution! Reboot back to Safe Mode.
• Defrag all Hard Disks, even if Windows says 0% fragmentation (a disk can have gaps in the free space and still show that 0%)

• Return to Virtual Memory and select Let me specify my own virtual memory settings
• Using the value determined above, set both the Maximum and Minimum to that amount. It's important to ensure Windows 95/98 never runs short. If unsure of your VM needs, you can set the Minimum to that figure and not set the Maximum. Setting both (same figure) has the advantage that Windows will not spend some time resetting the Maximum. The figure you enter is in Megabytes (MB), not in Kilobytes (KB).

• Place VM on a fast drive other that the Windows drive
• If you can, then place the VM on the fastest part of the hard disk - for quick access. Windows98 has this feature. The VM swap file is Win386.swp
• Or, if possible, first move all files from the selected drive, and then point your VM to that drive. That way the swap file will be placed at the beginning of the disk. Then proceed as above.

Try not to use more than 90% space if you place VM on a small partition .
Caution: It is best not to permanently switch off VM. Windows 98/95 sometimes requires access to it - or even systems with oodles of RAM may have the occasional error.

[top of page]

WINDOWS 98 VM      All users

98 VM is improved in Windows 98, SE & ME

Windows 98 manages the Swap File more efficiently than Windows 95, and it is not as essential to change from the dynamic setting (default).

Use the previous method to estabolish the correct setting for you own system.

Also you should ensure:

• the swap file is placed on the fastest drive (unless it is overused)

• if you stay with the dynamic setting, ensure the swap file disk has enough free space so that the swap file can shrink and grow as required by your usage

[top of page]

WHAT IS VIRTUAL MEMORY?

Windows uses hard disk space to simulate RAM

Modern programs (including Windows 95/98 itself) require large amounts of memory. Not all the components of these programs are needed in memory at any one time.

Virtual Memory (VM) is part of the hard disk used by Windows 95/98 to temporarily store some memory files not currently in use. They are stored on a designated area of the hard disk for easy retrieval when required. This frees some additional space in memory for files currently required, and more/larger programs can be run with a limited quantity of memory.

A Swap File (also called a Paging file) refers to a file swapped between VM and memory, and visa versa. VM is held in the swap file called Win386.swp

It is important to ensure access to VM is optimized, as the hard disk is many hundreds of times slower than memory. In systems with a shortage of memory there is constant swapping of files - a substantial slowing of the system occurs (and the hard disk can be heard working much of the time).

[top of page]

WINDOWS and VM

Microsoft Recommends:

Microsoft's recommendation is to allow Windows 95/98 to use Virtual Memory(VM) dynamically; to let it use as much of your free disk space as it needs at any one time. This is quite acceptable except that it leads to considerable fragmentation and constant time-consuming swapping of files. Both slow down an already slow process.

Under Windows 95/98, VM is allocated according to expected future needs, rather than on actual current needs.

If you have memory-intensive situations then you are likely to benefit from an alteration to the default setting. Certain changes to VM will lead to increase efficiency and less fragmentation. You can lessen the amount of virtual memory re-sizing, disk swapping, and constant hard disk access.

[top of page]

OPTIMIZING VM         All Users

Get the best from VM

Certain changes to Virtual Memory will lead to
increased efficiency and less fragmentation

• Alter the Windows 95/98 default VM setting (next)

• Give VM it's own small Partition (on another hard disk or Partition, if available)

• Put VM on the fastest hard disk, and point Windows there

• If possible, place VM on the fastest part of the disk (you may need Norton speed disk for this)
   - but don't do this if your system rarely uses VM (keep that prime disk area for your programs)

[top of page]

HOW MUCH VM?

In the past most users just used 2½-3 times the amount of installed RAM.

This blindly ignored the basic fact that users with little RAM need lots of VM, and users with lots of RAM need little VM.

For a more accurate assessment do the following:

The Maximum: You can work this out by following this procedure:
• First set Windows to control VM dynamically
• Now open ALL the programs you would ever expect to have open at any one time
• Use Find to locate the VM file (it is called win386.swp), open Windows Explorer, and look at the size of that file (you could use System Monitor to log your usage)
• That is the MAXIMUM size for your VM, though you would be advised to allocate 30-50MB more to allow for extra usage due to unforeseen circumstances where extra Virtual memory is needed

The Minimum: You need to set it to more than your requirements at boot-up
• Set VM to run dynamically
• Reboot, and open only the program(s) you always open concurrently
• The current size of win386.swp represents the MINIMUM size for your VM
• You are likely to gain by using the same size as the Maximum (Windows does not spend time resizing a static VM).

A Further Option (mostly large RAM systems):

Set the Minimum to your greatest VM usage (plus a little), and do not set the Maximum at all. This is suitable mostly for large RAM systems and will protect against that day when you suddenly DO need an unknown quantity of additional VM. The rest of the time the new Minimum will never be exceeded or even reached.

[top of page]

Notes on VM

The hard disk is one of the slowest components in your system which means the constant use of VM will considerably slow down your system - you regularly hear the disk being accessed, and you have to pause while the next part of your program opens (pauses without disk activity are usually the result of an under powered CPU).

The ideal situation is where there is no need to use VM, i.e. you have a surplus of memory. However let's be pragmatic. VM is useful, is an integral, and essential, part of Windows 95/98, and it does work. Normal (occasional) VM usage is not unhealthy, and is a necessary part of the Windows 95/98 operation. Reliance on VM as a replacement for some memory requirements will drag a system down to the very slow lane.

The real cure for excessively used VM is to add more memory. However there is much that can be done to optimize VM usage, and to make more usable memory available. You need to refer to the Memory (RAM Shortage) section on this site for improvements to systems with a memory shortage.

[top of page]

Conservative Swapfile Usage

98 98, SE & ME:   Limiting Virtual Memory use

ConservativeSwapfileUsage:
Windows will, by default, use some amount of Virtual Memory whenever it 'decides' it should do so. Windows is not always very wise! And, any paging to the swapfile degrades performance.

If you have plenty of main memory (at least 96MB+) then you can prevent Windows from using any VM while some memory remains to be used instead. The obvious speed boost will result in some circumstances.

Your system must meet both of these requirements before you use this tweak:
(a) your system seldom uses the swapfile (paging via Virtual Memory) - you can just listen for any Hard Disk usage as you use the computer, or monitor with SysMon (System Monitor).
(b) you have 98MB, preferably more, of physical RAM installed - it 'may' be beneficial on some 64MB systems, but be sure condition (a) is met.
1. Backup System.ini (its in the Windows directory)
2. Open System.ini in Notepad.
3. Scroll down to the bottom of the [386Enh] section
4. Edit in the new line:
ConservativeSwapfileUsage=1
5. Create a single blank line between this line and the next section of System.ini
6. Save, Exit, and Reboot.

There is no need to impliment this in Windows 95 systems.

[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