Loans | Loans | Loan | Best Credit Cards | Loans
Virtual Memory AKA Swap File [Archive] - PCMech Forums

PDA

View Full Version : Virtual Memory AKA Swap File


FZWG
09-06-2002, 09:43 PM
Read an article in a reputable magazine stating that the size of the swap file should be set to a minimum and maximum size which are the same. In this scenario the system will not have to slow down to resize this file.

The size recommended is 384 MB for the minimum and the maximum.

Appreciate some thoughts on this.

AzCoastie
09-06-2002, 10:38 PM
I've heard the same thing... Got mine set to 1024 (twice my SDRAM amount) both min & max w/ no problems. *knock on wood*

Someone who knows more than I about this will chime in soon! ;)

galaxian
09-06-2002, 10:43 PM
You have 512MBs installed and are running with a 1GB swapfile????

Have you looked with SYSMON to see exactly how much of it you are using? (or rather, are not using). Unless you are running many, many programs at once, or running very large programs like video editting, odds are very good that your swap file usage is zero!!

There is no formula for the swapfile size and a max should never be specified, ever.

AzCoastie
09-07-2002, 08:35 AM
Originally posted by galaxian
You have 512MBs installed and are running with a 1GB swapfile????

Have you looked with SYSMON to see exactly how much of it you are using? (or rather, are not using). Unless you are running many, many programs at once, or running very large programs like video editting, odds are very good that your swap file usage is zero!!

There is no formula for the swapfile size and a max should never be specified, ever.

I've been told to keep the swapfile min & max set to twice the RAM amount... This isn't correct?

Also, I have one 30GB and one 20GB HDD, so space isn't a problem.

Never heard of SYSMON... Something I have to download or is it in WinXP?

If max isn't specified and I leave it blank, won't the OS assume zero?

Thanks for your help! :D

galaxian
09-07-2002, 09:31 AM
Sysmon is a Win98 utility. I don't know if it is available on XP or not.
With no MAX, windows assumes unlimited. With a max, if it hits the top you get program errors or out of memory errors. With no MAX the file is just expanded.

If you find the XP monitor (or someone indicates where it is or another that can be used), I'm still betting that you are not using any of the swapfile, and you may as well just let windows manage it. On the other hand, obviously with your current config everything will still run OK.

Cricket
09-07-2002, 10:43 AM
Hi FZWG,

If you want Windows to use the swap file as little as possible, just have lots of physical RAM installed. The more RAM you have, the less Windows has to go to the swap file.

Which OS are you using? If you're on WinXP, I would just let it manage the swap file and system resources on it's own. If you're on Win98, I would still let it manage the swap file but would add this line to the [386Enh] section in system.ini using sysedit - ConservativeSwapFileUsage=1

:) Cricket

AzCoastie
09-07-2002, 07:40 PM
I tried to leave the max side blank and WinXP wouldn't allow it... It requires something there in order to set it. ;)

Don't know if it's accurate or not but M$ suggests having the swapfile located on a drive other than the one where the system files are located if possible... I've put it back to allow WinXP to manage it and set it to my slave HDD.

FZWG
09-07-2002, 10:55 PM
Thank you for the replies.

Got plenty of info to learn more about this issue.

Running W98SE with 448MB memory. Mostly use PC for Internet, and every now and then, a download. Nothing 'heavy'.

Virtual Memory is set to 384MB minimum and maximum.

TwoRails
09-07-2002, 11:17 PM
Hi FZWG,

I've read a large handful of articles on this, and it seems like there is no one set rule. This is because of all the variables, like RAM amount, what you are using your system for, size of files, number of programs you normally run at one time, etc...

Having a Min is about the only consistant item I've ever found. Setting a Max usually runs into errors. Mine is set to about 347 MB Min and no Max. I'm running 512 memory on a Win98 SE box. This seems to work the best for my needs. Feel free to experiment, but it may take a few attempts and do repetitive things to see which setting works best.

HTH

TwoRails

FZWG
09-08-2002, 12:19 AM
Thanks for the info, TwoRails.

W98SE requires some sort of an entry in the maximum amount. It does not accept a blank entry. Guess one can enter the entire size of space available on the hard drive????

TwoRails
09-08-2002, 12:42 AM
Hi FZWG,

Actually, there is a choice of "No Maximum." But there is more than one way..... In Virtual Memory, you can also Check to let Windows manage the swap file, and then add this line:

MinPagingFileSize=339292

To the:

386Enh

section of your System.ini file.

That's the same as setting Vitural Memory to a Min and No Max. The number is in KB, so the above number is 339.3 MB, roughly. So, if you wanted a 300MB swap file min, you would enter:

MinPagingFileSize=300000


HTH

TwoRails

Blakhart
09-08-2002, 01:59 PM
A minimum of around 300 is best, and if you never print things or use photo or video editing apps, you may also set the max at 300.
Vid/photo and printing apps may call for 768 or even greater swaps. It will always depend on the app, and dynamic swap as opposed to fixed can save the day for you. You will see an error message re mem if you do not have a big enough swap. So, setting a max limit can be a bad thing for some. Anymore, swapfile foolery gives less bennies than in older os's, such as 95/98/me. I still set mine on its own partition, and set it to the same min and max size. There is a slight performance increase in this, in my xp installs. Even better would be a separate drive altogether for the swap, parted out for swap and say kazaa-like data.......
This way using both ide channels, swaps can happen at the same time as os/app reads on the other drive.
While I am on my tirade, raid 0 would be far faster still, given like drives.

Jade
09-09-2002, 03:40 PM
I have mine set to 0 min and 96 max. I have 512 MBRam.

From what I know the more RAM you have the less you need the swapfile and more specifically a static swapfile.

From recall I believe the swapfile is an actual file on the harddrive. And a static swapfile interupts everytime you access the HD (since it is static) even when you don't need it. Thus it is a tax on your HD; the most bottleneck portion of most systems especially when you don't need it.

I could be wrong.

galaxian
09-09-2002, 07:15 PM
By static, I assume you mean permanent or semipermanent??

If so, there is no "interrupt" everytime you access the disk. If windows doesn't need to use the file, the file is not used, permanent of otherwise.

In your particular case, I don't know why you have bothered setting any parameters at all. Just let windows manage it.

Tuf
09-09-2002, 08:27 PM
i have run Windows for several years with lots of RAM and no swap file. I had never encountered any problems until I was trying to load some drivers from a floppy. Apparently sometimes you do need it, even 2MB would do it. If are not monitoring your computers useage it might be best to let Windows manage it.
In XP the Performance Tab in the Task Manager performa the role of System Monitor.

erucader
09-09-2002, 09:24 PM
If there is <128 Mb of ram is there benefit to manually setting swap file?

TwoRails
09-09-2002, 09:44 PM
Originally posted by erucader
If there is <128 Mb of ram is there benefit to manually setting swap file?

What I was trying to elude to above is that setting a Min is the easiest way to get a benifit from the swap file. It is indeed a file on the HD like any other file. If you have a min, then Windows doesn't have to keep changing it's size to accomodate a smaller file, thus you have a slight performance increase.

The only way Windows will thrash the swap file with a Min setting is if you need a larger file then the Min setting. This would be the case if you start running a large number of programs at one. If you do that (run a large number of programs at once) then just increase the Min size of the swap file.

HTH

TwoRails

TwoRails
09-09-2002, 09:50 PM
Originally posted by Jade
...snip...
From recall I believe the swapfile is an actual file on the harddrive. And a static swapfile interupts everytime you access the HD (since it is static) even when you don't need it. ,..snip...

Hi Jade,

I don't follow.... Yes, the swap file is a file on the HD. That's why "power users" put the file on their fastest drive. The Windows default is on the 'C' drive, which is typically the fastest in most systems (mainly due to most systems, including store bought, have only one drive)

I never heard of a "static" drive?? Are you referring to a RAM drive? They were OK in the olden, DOS days but don't really have much use in modern systems.

TwoRails

Blakhart
09-09-2002, 10:28 PM
No matter if the swap is disabled, the os still pages, it always will, and this is by design. So, you are better off leaving it as installed.

Jade
09-10-2002, 11:59 AM
Originally posted by TwoRails


Hi Jade,

I don't follow.... Yes, the swap file is a file on the HD. That's why "power users" put the file on their fastest drive. The Windows default is on the 'C' drive, which is typically the fastest in most systems (mainly due to most systems, including store bought, have only one drive)

I never heard of a "static" drive?? Are you referring to a RAM drive? They were OK in the olden, DOS days but don't really have much use in modern systems.

TwoRails

Static swapfile. I don't believe I used the term 'static drive'. And yes it means same size min and max.

I always thought a same sized swapfile means you are activating your HD for this purpose even when it is not being used. Thus slowing the HD even more.

I also use a tweak that perhaps no one uses (I just use parameters found in MS knowledge base) in that I force the use of 420MB evertime my comp starts up. Maybe I will post results for those at a later time.

galaxian
09-10-2002, 02:53 PM
Jade:
You indicate
"I have mine set to 0 min and 96 max. I have 512 MB Ram"
and then
"I force the use of 420MB evertime my comp starts up".

????
What "tweak" are you using?
And why?


Blakhart: The OS will find it very difficult to page if you have disabled virtual memory.

Babylon
09-10-2002, 05:33 PM
Just thought I'd add my own opinion from what I've read about Swap File settings. From what I've read the only point in making the max and min the same is to stop the HD fragmentation from the constantly re-sizing swap file. It's best to force windows not to use the swap file unless it is absolutely necessary using the method above.

I'd like to ask though, when I get a new PC I'm aiming to get an 80gb hard drive. If I partitioned it, into a 60 GB, and 20 GB section, would this slow down the drive at all? AM I best getting the company to install 2 drives instead? The reason I ask is that in the 20 GB partition (I might make it less, not sure) I hope to store all the files on my PC such as e-mail files, swap files, virus checker + firewall, and temp internet files to stop the rest of my HD from getting badly fragmented! Would this actually help?

TwoRails
09-10-2002, 09:05 PM
Originally posted by Jade


Static swapfile. I don't believe I used the term 'static drive'. And yes it means same size min and max.

I always thought a same sized swapfile means you are activating your HD for this purpose even when it is not being used. Thus slowing the HD even more.

I also use a tweak that perhaps no one uses (I just use parameters found in MS knowledge base) in that I force the use of 420MB evertime my comp starts up. Maybe I will post results for those at a later time.

Hi Jade,

Ya, I don't know where "drive" came from...

No, setting the min / max to the same does not trash the HD any more than normal.

I don't follow you again about the tweak. Setting the Min to 420 sets the file size to that min. Windows does Not create the swap file on startup. Start in DOS an you will find the swap file still there from the prior Windos session, it doesn't go away.

TwoRails

TwoRails
09-10-2002, 09:08 PM
Originally posted by Babylon
Just thought I'd add my own opinion from what I've read about Swap File settings. From what I've read the only point in making the max and min the same is to stop the HD fragmentation from the constantly re-sizing swap file. It's best to force windows not to use the swap file unless it is absolutely necessary using the method above.

I'd like to ask though, when I get a new PC I'm aiming to get an 80gb hard drive. If I partitioned it, into a 60 GB, and 20 GB section, would this slow down the drive at all? AM I best getting the company to install 2 drives instead? The reason I ask is that in the 20 GB partition (I might make it less, not sure) I hope to store all the files on my PC such as e-mail files, swap files, virus checker + firewall, and temp internet files to stop the rest of my HD from getting badly fragmented! Would this actually help?

Hi Babylon,

You are right! The main reason for setting swap file sizes is indeed to stop the trashing of the HD, at least for that file, which, in turn gives a small performance increase.

As far as partitioning and multi drives (physical / logical) -- that's one of my favorite subjects!! Since dinner is ready, I'll just quickly say: 1) Yes, partitioning and multi drives (physical / logical) are of a large benefit for many reasons, and 2) that would be better for a New thread, as you'll get more direct posts on the subject!

Gotta go eat!! :D :D

TwoRails

galaxian
09-11-2002, 11:49 AM
Quick supplement.
If you set a MIN the swapfile is created as contiguous. There is not need to set a MAX. In fact, there is absolutely no benefit whatsover in setting a MAX.

As for a windows managed swapfile NOT being created at boot time. This is not true for Windows 95, but started with Windows 98.

FZWG
09-12-2002, 05:53 PM
Thanks for all the replies. Plenty of food for thought.

galaxian
09-14-2002, 05:03 PM
Originally posted by Jade
I also use a tweak that perhaps no one uses (I just use parameters found in MS knowledge base) in that I force the use of 420MB evertime my comp starts up. Maybe I will post results for those at a later time.

Just a bounce hoping Jade will explain what this tweak is.

glc
09-17-2002, 07:40 PM
I have always managed my swapfile like this - I disable virtual memory, reboot, and defrag. Then I set a static size swapfile at 1.5x my physical ram and reboot. This sets the swapfile in stone completely unfragmented and keeps it this way. I know there are both advantages and disadvantages to doing it this way, but at least I know it's there and it's not gonna get fragmented. I'm not concerned about minor performance differences, I'm more concerned about keeping it minimum maintenance.

galaxian
09-17-2002, 11:37 PM
As I indicated above, there is no need to set a MAX on the file. A MIN alone will create a contiguous file (unfragmented).
The only thing that a MAX will do on the swapfile (which is obviously non productive) is potentially cause program failures on Out of Memory.
There are no benefits to setting an upper limit.

glc
09-17-2002, 11:45 PM
If that happens - I start over and make it bigger, no biggie. Hasn't happened yet.

Jade
10-05-2002, 09:00 PM
Originally posted by galaxian
Jade:
You indicate
"I have mine set to 0 min and 96 max. I have 512 MB Ram"
and then
"I force the use of 420MB evertime my comp starts up".

????
What "tweak" are you using?
And why?


Blakhart: The OS will find it very difficult to page if you have disabled virtual memory.

0min 96max Swapfile
420MB of RAM (real RAM) not swapfile or Virtual Memory

Sorry for beating a dead horse here but I guess I haven't been around much.

It is a system.ini setting I used for RAM. I did notice a slight increase for me (keyword: me)

You are familiar with SYSTEM.INI too right? (under the well known [386Enh] settings)

run>system.ini

Here is what I had on mine and did notice an increase in some games. benchmarking or running games after each changes is still key.

[386Enh]
MinPhysPage=1C000 <- force windows 98 to utilize 448MB of RAM
MaxPhysPage=3C000 <- this is to let Windows utilize more that 512, if it works now don't implement it.

FYI


No baby diodes or electrobes were hurt in the process

Jade
10-05-2002, 09:04 PM
Originally posted by glc
I have always managed my swapfile like this - I disable virtual memory, reboot, and defrag. Then I set a static size swapfile at 1.5x my physical ram and reboot. This sets the swapfile in stone completely unfragmented and keeps it this way. I know there are both advantages and disadvantages to doing it this way, but at least I know it's there and it's not gonna get fragmented. I'm not concerned about minor performance differences, I'm more concerned about keeping it minimum maintenance.

I disable fully before defragging as well. the only dif is I don't let windows resize itself by 0 min 96 max settings. 96 for a long lost particular reason.

0 for not letting (Virtual) Memory interupt the hard drive at all, which is still the bottleneck in most of todays systems.

TwoRails
10-05-2002, 10:28 PM
Ahh..... the "MinPhysPage" and "MaxPhysPage" thing has nothing to do with the Swap File.

"min" is about usless, and all that MaxPhysPage does is limit the amount of memory Windows sees !!!

It is eqivalent of removing a stick of memory: meaning if you had 512 MB in two memory sticks and use / set MAXPhysPage to 256 MB, then pulling one stick works just the same.

This is a "work-around" for Windows bad memory managment and is from the Early days of windows.

TwoRails

Jade
10-06-2002, 01:34 PM
Originally posted by TwoRails
Ahh..... the "MinPhysPage" and "MaxPhysPage" thing has nothing to do with the Swap File.

"min" is about usless, and all that MaxPhysPage does is limit the amount of memory Windows sees !!!

It is eqivalent of removing a stick of memory: meaning if you had 512 MB in two memory sticks and use / set MAXPhysPage to 256 MB, then pulling one stick works just the same.

This is a "work-around" for Windows bad memory managment and is from the Early days of windows.

TwoRails

First I apologize it I didn't make it clear the tweak wasn't about the swapfile and was a tweak about REAL Memory.

-THE TWEAK I TESTED FOR MYSELF WAS FOR UTILIZING REAL MEMORY NOT VIRTUAL.-

That particular Max size the is a limiter for 940MB ram. So no, sorry, it is not the same as removing a stick out. If you find the hexidecimal value of 1.5GB ram you can put it in there, if you do have 1.5GB installed.

Your current Virtual Memory suggestions are actually the "work-around for Windows bad memory managment and is from the Early days of windows."

TwoRails
10-06-2002, 05:56 PM
Originally posted by Jade
...snip... That particular Max size the is a limiter for 940MB ram. So no, sorry, it is not the same as removing a stick out. If you find the hexidecimal value of 1.5GB ram you can put it in there, if you do have 1.5GB installed. ...snip...

If you set Max to 940 MB (or whatever size) and have 1.5 GB in the system (or whatever size over the 940 MB) then Windows does Not see the memory over 940 MB. If Windows does not see it, it does not Use it. Therefore, it's a waste of memory.

In my example, using standard memory stick sizes, yes, it is the same as removing a stick. 512 MB in two sticks, limited to 256 MB by Max does have the same result as removing a 256 stick, since windows does not use it.

Also, if you do have 1.5 GB and set Max to 1.5 GB, then there is no need to have the Max statement at all.

In all of Microsoft's articles that contain the Max statement, they all are refering to memory related Problems, and none that are related to boosting performance.

Max is from the olden days and most articles say things like, If your system won't run good on more than 16 MB of memory you can set Max to limit memory to 16MB !! Gee, that was what, Win 3.1? Maybe Win 95? I don't think there are many members of this forum that have a running system with only 16 MB, unless they are maybe using it for a typewriter.

TwoRails

galaxian
10-06-2002, 07:22 PM
I agree with TwoRails.

The max is limiting the RAM that windows can see and use. The "3C000" restricts it to 960MBs (1,006,632,960 bytes)

Also, a swapfile setting of min 0 and max 96 has not affect on swapfile resizing. This setting allows the file to grow/shrink between 0 and 96MBs. If you want to stop the shrinking (which really won't buy much except on Win95), you set the MIN to a setting above your normal usage.
And, as always, a MAX is never a good idea.

Jade
10-06-2002, 10:07 PM
Man. I should never discuss the tweaks I only seem to do to windows on the side.

I do not have 1.5 GB [I DID NOT SAY ANYWHERE I HAD THAT COMBINED IN 1 MACHINE]. I have 512 and 768mb RAM [NOTE IN 2 DIFFERENT MACHINES]. I have a 667mhz celeron and someone's old 500mhz PIII after they upgraded.

I have them tweaked so both cream the pants off 1.7 and other P4's that guys can't understand where they went wrong, but yet they still rank higher amoung other online buddies.

Forget what I said, I may in fact have skipped a step or 2 along the way.

I never said MinFilePage had anything to do with the Swapfile.

Jade
10-06-2002, 10:11 PM
Originally posted by TwoRails


If you set Max to 940 MB (or whatever size) and have 1.5 GB in the system (or whatever size over the 940 MB) then Windows does Not see the memory over 940 MB. If Windows does not see it, it does not Use it. Therefore, it's a waste of memory.

In my example, using standard memory stick sizes, yes, it is the same as removing a stick. 512 MB in two sticks, limited to 256 MB by Max does have the same result as removing a 256 stick, since windows does not use it.

Also, if you do have 1.5 GB and set Max to 1.5 GB, then there is no need to have the Max statement at all.

In all of Microsoft's articles that contain the Max statement, they all are refering to memory related Problems, and none that are related to boosting performance.

Max is from the olden days and most articles say things like, If your system won't run good on more than 16 MB of memory you can set Max to limit memory to 16MB !! Gee, that was what, Win 3.1? Maybe Win 95? I don't think there are many members of this forum that have a running system with only 16 MB, unless they are maybe using it for a typewriter.

TwoRails

I never said I had 1.5 GB I was using it as an example. Unfortunately most 98 or 98se systems do need a statement. Which is why most 98 or 98se cannot utilize more than 512 by default. NOTE I SAID MOST, NOT ALL.

I am really spending too much time explaining every single little thing here. I will end it with this a bid you adieu.

Keep upgrading every 6 months my tweaked 500 will still beat most.

galaxian
10-07-2002, 11:38 AM
By default, Windows CAN use more than 512MBs. It can "see", what the mobo can "see".
But, on some boxes above 512, vcache can take over all the virtual addresses resulting in out of memory errors.
The "tweak" required, is to constrain vcache at a size under 512MBs.

Setting MaxPhysPage to 960MBs on a 512 or 768 box, is the same as not setting it at all.
You may have done some great tweaks to make your PC fly, but I don't believe this particular parameter did anything?

TwoRails
10-07-2002, 06:09 PM
Nicely put, galaxian.

Jade
10-09-2002, 09:36 PM
perhaps not but maybe I just don't take kindly to ppl telling me what I am doing makes no sense.

Go ahead, go for the safe route. I will continue to experiment and expericment where and when I can. All I know is there were many 98 boxes that didn't utilize more than 256mb by default

TwoRails
10-09-2002, 09:57 PM
Originally posted by Jade
perhaps not but maybe I just don't take kindly to ppl telling me what I am doing makes no sense.

Go ahead, go for the safe route. I will continue to experiment and expericment where and when I can. All I know is there were many 98 boxes that didn't utilize more than 256mb by default

Hi Jade,

First, please take this as it is ment; in a friendly, kind way.

When someone makes a claim, it can be "challenged" or questioned. This is normal and should Not be taken personal. For example, when someone asks about HD and I recommend making multi-partitions, I often get challenged. I then share the reasons why I recommend partitioning. When I make a claim of how fast my hard drives are, I back it up with screen shots to show that they are hot rods.

The same goes for "tweaks," and other profound statements; you should expect to be questioned. People what to know how it works, escpecially here. This has nothing to do with taking something personal.

Your tweak does not make sense to some of us and we therefore do not see how it works. Instead of taking negitively, try taking it positively and show us that it actually works.

You can do this maybe with benchmarking the "before tweak" and "after tweak" and posting the actual screen shots, as I and many others have done with stuff.

It's like trying to tell someone that driving with the tail gate down will increase performance. So to prove that it works (and it doesn't: see below) you could go to the local drag strip and make multiple pass with it down and up, then show your time cards proving, or disproving, the results.

HTH,

Sincerely,

TwoRails

PS: of the big three (Dodge, Ford, and Chevy), two did exhaustive testing on the tail-gate-down-theory and found it didn't make a difference. The third (forget which one) didn't waste their money.

galaxian
10-09-2002, 10:06 PM
Nicely put, TwoRails. :)

Jade
10-13-2002, 07:02 PM
Originally posted by TwoRails


Hi Jade,

First, please take this as it is ment; in a friendly, kind way.

When someone makes a claim, it can be "challenged" or questioned. This is normal and should Not be taken personal. For example, when someone asks about HD and I recommend making multi-partitions, I often get challenged. I then share the reasons why I recommend partitioning. When I make a claim of how fast my hard drives are, I back it up with screen shots to show that they are hot rods.

The same goes for "tweaks," and other profound statements; you should expect to be questioned. People what to know how it works, escpecially here. This has nothing to do with taking something personal.

Your tweak does not make sense to some of us and we therefore do not see how it works. Instead of taking negitively, try taking it positively and show us that it actually works.

You can do this maybe with benchmarking the "before tweak" and "after tweak" and posting the actual screen shots, as I and many others have done with stuff.

It's like trying to tell someone that driving with the tail gate down will increase performance. So to prove that it works (and it doesn't: see below) you could go to the local drag strip and make multiple pass with it down and up, then show your time cards proving, or disproving, the results.

HTH,

Sincerely,

TwoRails

PS: of the big three (Dodge, Ford, and Chevy), two did exhaustive testing on the tail-gate-down-theory and found it didn't make a difference. The third (forget which one) didn't waste their money.


Nicely put.

PS. Of the Big 3. 2 were very active in getting their vehicles and bridges for the WWII effort. The third (won't name what brand) went and recieved his iron cross from Hitler himself. His first name was Henry.

TwoRails
10-13-2002, 08:40 PM
Hi Jade,

Interesting note about Henry and WW II. I've been to the Ford museum in Detroit and seen some car history (pretty kewl place) -- but I have to admit my WW II history is very poor.

TwoRails