Optimal XP Pro Swap File Size?

T

Tom

Hi, what is the recommended swap file size for PCs running XP pro, 70GB-
80GB HDD, when one PC has 512MB RAM installed and the other has 2GB RAM
installed? Shoud XP determine the swap file size?

Tom
 
R

R. McCarty

There is a general "Rule" that the Pagefile should be 1.5 times physical
RAM. However, the base size needs to equal Physical RAM to do a
Full Memory dump. Actual usage varies according to what you use &
how much RAM it requires. With current PCs having 1.0 Gigabytes or
more you'll find that the Pagefile traffic is just around ~50-75 Meg with
normal use.

You can move it, resize it, defrag it and all other kinds of tweaks but
it's easiest to just let Windows manage it. Some "Performance" sites
recommend turning it off but that works against the design of a Virtual
memory system.
 
U

Uncle Grumpy

R. McCarty said:
You can move it, resize it, defrag it and all other kinds of tweaks but
it's easiest to just let Windows manage it.

I set it on a different drive (not partition), larger than recommended
and with the min and max the same.
 
R

R. McCarty

That setup is something that has merit, as long as the drive
has equal or better specs than the one that XP is installed on.
Setting the Min/Max prevents the pagefile from expanding if
more is needed - but that doesn't happen very often. Still for
the average user the internal management is adequate.
 
V

VanguardLH

in message
There is a general "Rule" that the Pagefile should be 1.5 times
physical
RAM. However, the base size needs to equal Physical RAM to do a
Full Memory dump.

Actually the base pagefile size should be equal to the physical RAM
size plus 64KB. This limitation is superfluous if you configure
Windows to NOT save a dump, even a small one, when it crashes. This
is not related to the 64KB size for the smallest size selectable for a
crash dump logfile. I can't remember why I include this extra 64KB
but it's something that has stuck with me for years of doing QA
testing on multiple Windows platforms.
Actual usage varies according to what you use &
how much RAM it requires. With current PCs having 1.0 Gigabytes or
more you'll find that the Pagefile traffic is just around ~50-75 Meg
with
normal use.

I use the general rule of setting pagefile space:

- For 256MB, or less, set the minimum pagefile size to 384MB.

- For more than 256MB but less than 1GB, set the minimum pagefile size
to 1.5 times the size of physical RAM.

- Above 1GB, set maximum pagefile size to 1 times the size of physical
RAM.

- These defaults may be overridden if you use an application that
wants LOTS of pagefile space. Most end-users don't run
enterprise-level applications on their workstations so this rarely is
a need.

- If there are multiple hard disks, split the pagefile across those
hard disks (at 1 times the size of the physical RAM for the pagefile
on each hard disk). The partition must obviously not be hidden for
Windows to use that pagefile. Use only one pagefile in one unhidden
partition per hard disk. This helps performance because Windows will
first attempt to use pagefiles in partition on hard disks other than
the partition in which Windows is installed to permit overlapped I/O
to those hard disks. It is possible to allocate a tiny pagefile in
the Windows partition and just use the pagefiles in the other
partitions for virtual memory but I recommend the 1x size in case you
later lose the other hard disk(s). Do not place multiple pagefiles in
different partitions on the same hard disk.

- If you enable dump file logging on a Windows crash, add 64KB to the
minimum size. Unless you are a developer debugging your own
application that crashes, the crash dump is rarely requested by
technical support (they usually don't know what to do with it). Users
don't know what to do with the dump logs. On my work host, crash
logging is enabled (complete memory dump). At home, it is disabled
(none).

Often I use a simpler algorithm: 1.5x for under 1GB of RAM, 1x for 1GB
and up, set minimum = maximum for the pagefile size, and disable crash
dump logging.
You can move it, resize it, defrag it and all other kinds of tweaks
but
it's easiest to just let Windows manage it.

Actually you will want to set the minimum and maximum pagefile size to
the same value to reduce fragmentation of its file space on your hard
disk. Set min and max to the same value and reboot to use the new
values. However, to remove any defragmentation already present in the
pagefile.sys file, you will need to use a defragmenter that will touch
that file, like SysInternals' PageDefrag (free). There is another
trick of deleting the pagefile.sys file by rebooting into Recovery
Console mode, unhiding that file, renaming it to something else, and
then deleting it, and reboot back into Windows.

If you let Windows manage the pagefile size between two different
values for minimum and maximum size, the pagefile is more likely to
get defragmented. With minimum = maximum, there will probably be 2 or
3 fragments for the pagefile but it won't get worse over time.
Some "Performance" sites
recommend turning it off but that works against the design of a
Virtual
memory system.

Even if you had a terabyte of physical RAM, some pagefile space is
always used by the OS and your applications. Applications may not
function if there is no pagefile space (i.e., you have gobs of
physical memory and set max size of the pagefile to zero). Even
Windows might not run since it expects to put part of its Exec into
the pagefile (which can be reduced with a registry tweak but not
completely eliminated). Some applications know that their data
sections or some code should be pushed into the pagefile because the
performance of the application is not impacted by using the pagefile
and they don't want to consume more physical RAM than they really
need.

An application may easily ask for hundreds of megabytes of storage
(which goes through the Virtual Memory since Virtual Memory is always
in operation even if the pagefile min and max are set to zero). Most
users never see this. Include the VM Size column in the Processes tab
of Task Manager. For example, I've seen some user proclaim that a
particular anti-virus product has less memory consumption than some
other anti-virus program that they want to pan but they never bother
to check the TOTAL memory consumption by checking how much pagefile
space is consumed by their favorite anti-virus program. You might see
in Task Manager that your favorite program only consumes 10 to 20 KB
of physical memory (under the Memory Usage column) but neglect to see
that it eats up another 150MB in the pagefile. They don't realize
their favorite program is a pig on memory consumption because most of
the data and some of its code remains dormant until the active stub
needs it. I've seen security suites that include privacy protection
mechanisms, like site blocking, where the configured table of blocked
URLs and sites is data that gets loaded into the pagefile and eats up
100 to 150 MB just for that table.

http://support.microsoft.com/kb/555223
http://members.shaw.ca/bsanders/WindowsGeneralWeb/RAMVirtualMemoryPageFileEtc.htm
http://smallvoid.com/article/windows-page-file.html
 
P

Pennywise

Tom said:
Hi, what is the recommended swap file size for PCs running XP pro, 70GB-
80GB HDD, when one PC has 512MB RAM installed and the other has 2GB RAM
installed? Shoud XP determine the swap file size?

With 2.5GB of ram and following the baseline you would have a huge
pagefile.sys.

Ram is faster than Disk Access, you have enough ram you can start
cutting down on the swap file; you could even go without a swap file
with 2.5 Gigs memory.

I have 2.5 gigs of memory and a 300Meg swap file (pagefile.sys), I'm
just not ready to run without a swap file.
 
P

Pennywise

when one PC has 512MB RAM installed and the other has 2GB RAM

I missread this, who'd of thought....

2GB cut down on the swap file, 512MB run about a 750MB swapfile.
 
K

Ken Blake, MVP

Hi, what is the recommended swap file size for PCs running XP pro, 70GB-
80GB HDD, when one PC has 512MB RAM installed and the other has 2GB RAM
installed?


This is *not* the same for everyone with the same amount of RAM. The
most significant criteria for determining the page file size needed
are what apps you run, and how much you run simultaneously. The more
you have running, the more total virtual memory (RAM plus page file)
you need to accommodate it.

Beware of advice to make it some factor of the amount of RAM you have;
that's only significant with respect to dumps, and most people have no
need of dumps.

Contrary to the usual advice, the more RAM you have, the *less* page
file you need (since the page file substitutes for RAM when you don't
have enough).

Shoud XP determine the swap file size?


Despite everything I said above, making the page file smaller than the
Windows default accomplishes nothing but saving a small amount of disk
space. Although that used to be a valuable thing to do, in these days
of very inexpensive large disk drives, the value of doing that is
insignificant, and most people should just accept the Windows default.
 
S

Shenan Stanley

Tom said:
Hi, what is the recommended swap file size for PCs running XP pro,
70GB- 80GB HDD, when one PC has 512MB RAM installed and the other
has 2GB RAM installed? Shoud XP determine the swap file size?

The proper setting for Virtual Memory in Windows XP - in my opinion - is
"System Managed"...
 
P

philo

Shenan Stanley said:
The proper setting for Virtual Memory in Windows XP - in my opinion - is
"System Managed"...


<snip>

I agree...just let Windows manage it and forget it
 
M

Meat Plow

This is *not* the same for everyone with the same amount of RAM. The
most significant criteria for determining the page file size needed
are what apps you run, and how much you run simultaneously. The more
you have running, the more total virtual memory (RAM plus page file)
you need to accommodate it.

Beware of advice to make it some factor of the amount of RAM you have;
that's only significant with respect to dumps, and most people have no
need of dumps.

Contrary to the usual advice, the more RAM you have, the *less* page
file you need (since the page file substitutes for RAM when you don't
have enough).




Despite everything I said above, making the page file smaller than the
Windows default accomplishes nothing but saving a small amount of disk
space. Although that used to be a valuable thing to do, in these days
of very inexpensive large disk drives, the value of doing that is
insignificant, and most people should just accept the Windows default.

Some processes use the page file regardless. I agree with letting XP
decide it's size. In linux my swap file doesn't exist because it's not
needed with 4 gigs of ram (even with 1 or 2). Big diffference over XP's
page file.
 
K

Ken Blake, MVP

With 2.5GB of ram and following the baseline you would have a huge
pagefile.sys.

Ram is faster than Disk Access, you have enough ram you can start
cutting down on the swap file; you could even go without a swap file
with 2.5 Gigs memory.

I have 2.5 gigs of memory and a 300Meg swap file (pagefile.sys), I'm
just not ready to run without a swap file.


You should *never* run without a page file, no matter how much memory
you have. If you did so, you wouldn't be able to use all the RAM you
have. That's because Windows pre-allocates page file space, in
anticipation of possibly needing to use it. Although that
pre-allocation speeds up page file use if it's needed, in most cases
if you have enough RAM, that pre-allocated space is never needed and
never actually gets used.

But if there is no page file, that pre-allocation has to get made in
real memory (RAM) instead. That means that the space for that
pre-allocation (and it can be substantial) is tied up and not
available for any other use.
 
J

jorgen

You should *never* run without a page file, no matter how much memory
you have. If you did so, you wouldn't be able to use all the RAM you
have. That's because Windows pre-allocates page file space, in
anticipation of possibly needing to use it. Although that
pre-allocation speeds up page file use if it's needed, in most cases
if you have enough RAM, that pre-allocated space is never needed and
never actually gets used.

But if there is no page file, that pre-allocation has to get made in
real memory (RAM) instead. That means that the space for that
pre-allocation (and it can be substantial) is tied up and not
available for any other use.

Can you point to some technical papers at microsoft to back that up?
 
R

R. McCarty

http://en.wikipedia.org/wiki/Virtual_memory

Virtual Memory systems has been around for a long time. The
DEC VAX computer system ran VMS ( Virtual Memory System ).
Some of the creators of VMS where responsible for the original
Windows NT OS.

Even if you turn off the pagefile, XP will create a temporary one in
C:\Windows\System32 as TempPF.Sys
 
P

Pennywise

Can you point to some technical papers at microsoft to back that up?

I just deleted my Pagefile.sys (no page file setting), and ran PerfMon
It's a lot different than last time I used it; Lots of .net settings.
But set: .NET CLR memory

"This counter displays the amount of virtual memory (in bytes)
currently committed by the Garbage Collector. (Committed memory is the
physical memory for which space has been reserved on the disk paging
file)."

Shows 0, nada

And I still get my kills in COD4 :}
 
P

Pennywise

R. McCarty said:
http://en.wikipedia.org/wiki/Virtual_memory

Virtual Memory systems has been around for a long time. The
DEC VAX computer system ran VMS ( Virtual Memory System ).
Some of the creators of VMS where responsible for the original
Windows NT OS.

The AmigA never used a swap file, did with 10megs what it takes
windows 256megs and a swap file to do. And you just pushed the button
to turn them off, no asking the system if it was ready of not.
Even if you turn off the pagefile, XP will create a temporary one in
C:\Windows\System32 as TempPF.Sys

I don't find that file (TempPF.Sys) anywhere on the OS partition or
C:\ drive
 
J

jorgen

R. McCarty said:
http://en.wikipedia.org/wiki/Virtual_memory

Virtual Memory systems has been around for a long time. The
DEC VAX computer system ran VMS ( Virtual Memory System ).
Some of the creators of VMS where responsible for the original
Windows NT OS.

Virtual memory "space" is not equal the paging file. A page can be
backed up by real ram, a paging file or something else
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top