Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Swap File Best Practices 4

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
What is the best size for the Windows 98 se swap file? I'll be redoing a PC from FDISK on and would like to tune it optimally. Also, I know there were pros & cons for using a Min\Max swap file size for Windows 95 as opposed to letting the OS do it.

Is there a Win98 fomula based on the amount of RAM etc.? I'll have 256 mb of RAM. You comments are much appreciated on this topic.


Thanks for your time and advice,

Michael
 
With 256 Meg of RAM a 512Meg swap file should be good. Too big and system performance suffers. Too small and you have too much disk traffic. James Collins
Field Service Engineer
A+, MCP

email: butchrecon@skyenet.net

Please let us (Tek-tips members) know if the solutions we provide are helpful to you. Not only do they help you but they may help others.
 
Michael,

Another recommendation:

In Win98SE, I have always heard and practiced going only 12MB over the physical memory size in the machine as anything over this will be unused. In this case that would be 256+12=268MB. Any more than that and you will waste HDD space, and 244MB will be unused. It can even in some cases (depending on the machine) slow the system down.

Hope this helps!
Matt A+, MCP, MCP+I, MCSE Windows NT 4.0, MCSE Windows 2000 Early Acheiver with Security Emphasis

Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
It used to be said that the ideal size for the swap file was twice the physical RAM, however with todays systems having very large amounts of RAM I do not believe that necessarily applies. I certainly would not go over 512MB. In addition I have always set the minimum and maximum sizes to the same figure, thus giving a static rather than dynamic swap file. This should help to cut down on fragmentation which can be a big problem with large swap files.
 
I have just one thing you might like to consider since you're partioning. Create a partition for your swap file. Having your swap file on a seperate drive eliminates fragmentation of both your working drives and your swap drive. When I was running Windows 95 I eventually would install a second drive solely for the swap file. That's an even better way to do it, but a swap partition will improve performance. In fact it's a standard practice in UNIX and Linux installations. Don Swayser
swayser@optonline.net
 
Another way to eliminate fragmentation is to defrag (ideally from safe mode) then set virtual mem so that min = max on the same drive. This will establish an immovable allocation on the drive which won't therefore become fragmented.
For information, I have used this setup on another partition at various sizes, from 100Mb to 3Gb and noticed no difference at all between them.
I'm currently trying it on C:, sized at 300Mb. (I have 256Mb RAM installed.) My suggestions are what I would try myself. If incorrect, I welcome corrections to my rather limited knowledge. Andy.
 
A lot of people tend to miss the basic idea behind the swapfile. It's supposed to back up the RAM, not replace or add to it. In other words, it's used only if you don't have enough RAM. Therefore, the more RAM you have, the smaller your swapfile needs to be.

How small (or large)? That depends on two things: 1) How much RAM do you have? and 2) How much RAM do you use?

To answer both of these two questions in one step: Set Windows to Manage the swapfile, open Microsoft's System Monitor (see next paragraph), set it up to monitor the "Swapfile In Use", and then push your PC system to the limit. Open up as many programs as you might ever use, run as much as would be normal for you. This will create the largest swapfile you will ever see on your machine.

If you don't see System Monitor, look for C:\WINDOWS\SYSMON.EXE, or you may have to add it from System Tools using Windows Setup in Add/Remove Programs.

Once you know the largest swapfile size for your PC (for example, 30MB), then add a safety margin (for example, 30 + 10 = 40MB). Now fix the size of the swapfile to the max+safety (for example, 40MB).

It's also better to defragment your hard disk before you fix the swapfile size. This will make the swapfile contiguous (all in one spot). Even better is to place the swapfile on the outer edge of the platter in the hard disk using a program like Symantec's Norton Speed Disk. This will help improve efficiency by placing the swapfile in the spot where access is the fastest.

This procedure will optimize the swapfile for your particular system.

See for more information, including considerations for moving the swapfile to another hard drive disk.

The ultimate for swapfile information is at
However, that site has been unavailable recently (as of 12/31/01):
 
All these suggestions are exatcly what I was looking for. I am finding it all very helpful.

In short I have heard of hacks on tweaking but wanted to get closer to the real reason to make these changes rather than doing them blindly and hoping the were best. I guess to a degree we are all in this same boat.

Please keep this string going if you feel there is yet room for more clarity or better optimization methods.

Michael
 
All these suggestions are exatcly what I was looking for. I am finding it all very helpful.

In short I have heard of hacks on tweaking but wanted to get closer to the real reason to make these changes rather than doing them blindly and hoping the were best. I guess to a degree we are all in this same boat.

Please keep this string going if you feel there is yet room for more clarity or better optimization methods.

Michael
 
There is a way to force Windows to use RAM rather than swap file where possible:

Run 'System.ini'

Under the [386Enh] heading add the line

ConservativeSwapfileUsage=1

Be sure to leave a blank line between this and the next heading.
Save the changes on the way out, and re-boot.
This is most useful if you have a large amount of RAM installed, 128Mb or more. My suggestions are what I would try myself. If incorrect, I welcome corrections to my rather limited knowledge. Andy.
 
OK, I need some elaboration. In Windows 98se, will you gain performance if you have created a swap file with BOTH the min. and max. swap size set to a reasonable size based on your system?

The belief seems to be that setting both of these creates a permanent swap file that is contiguous thus faster.

Some of the atricles indicated in earlier threads side setting just the minimum size.

Thanks for your comments,

Michael
 
Keeping the swap file constant does increase performance a TAD. May not be noticable. Windows does not have to take the millisecond to resize it then. I keep the min and Max the same. James Collins
Field Service Engineer
A+, MCP

email: butchrecon@skyenet.net

Please let us (Tek-tips members) know if the solutions we provide are helpful to you. Not only do they help you but they may help others.
 
Setting the maximum is optional, and generally not recommended. This is contrary to what my earlier post suggested, because - for whatever reason I don't remember - when I tried to set a swapfile on my system with only a minimum I had a problem. It was so long ago, I don't even remember what the problem was. (That long ago it might have been inexperience.)

Here's the logic behind leaving the maximum out, taken from
A permanent swapfile has no maximum - it is allowed to expand up to the full 2GB (or free disk space if lower). The permanent aspect comes from the fact that because a minimum has been specified, the swapfile never shrinks below that value. Thus if your minimum is set to suit your "peak" allocations during a normal working day, resizing above this value should be rare and minimal. And because there is no maximum, you are not restricting your machine's ability to run more programs than you normally would. Thus we never set a maximum - we allow the swapfile to expand as much as it needs to. Free disk space sets an effective maximum in any case, and, since this fluctuates, it would be easy for the free disk space to fall below any maximum you set. The swapfile should be allowed to use as much disk space as it needs. The following quote from John Sheehy (a regular contributor to the alt.windows98 newsgroup) more or less sums up the maximum setting: "All you need is a minimum for the file to be permanent; one with a maximum is permanent *and* limited, but one that has only a minimum is permanent and *unlimited*."

--------------------------
If you want to get into tweaking, an excellent site for this is
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top