Swap file location

Monkey muppet

Golden Member
Sep 28, 2004
1,241
0
0
Is there any noticable difference to putting the 1.5x size of RAM swap file on a different HDD than the OS (specifically XP)?
 

evilharp

Senior member
Aug 19, 2005
426
0
0
In my opinion, yes it makes a difference.

I usually place the swap file (virtual memory/page file/whatever) in it's own partition (or drive), seperate from the OS and lock it at min/max 1.5 X physical ram. Why?

Well, going back to Win9x, and WinNT I was constantly fighting with fragmented files. Placing the swap file on a seperate partition or drive helped cut down on fragmenting (especially once the size was locked). It also allowed me to defrag my drive using the earlier "Disk Defragmenter" that came with both OSes (I'm too cheap to buy a 3rd party app), as resizing or writing to the file by the OS caused the defrag to restart from the beginning.

Secondly, fixing the size seemed to cut down on delays caused by the OS inflating/deflating the file when memory demands changed.

XP may be better at managing the page file, but I don't care to try.
 

TonyRic

Golden Member
Nov 4, 1999
1,972
0
71
rule of thumb is the manufacturers recommended size for a pagefile placed on the MOST USED partition of the LEAST used HDD.

EDIT: and locking the size eliminates fragmentation.
 

ZoomStop

Senior member
Oct 10, 2005
841
0
76
Originally posted by: TonyRic
rule of thumb is the manufacturers recommended size for a pagefile placed on the MOST USED partition of the LEAST used HDD.

Too early in the morning to try and wrap my head around that one, lol

 

TonyRic

Golden Member
Nov 4, 1999
1,972
0
71
Originally posted by: AcidBath
Originally posted by: TonyRic
rule of thumb is the manufacturers recommended size for a pagefile placed on the MOST USED partition of the LEAST used HDD.

Too early in the morning to try and wrap my head around that one, lol



What is so difficult about it? lol
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
Originally posted by: Monkey muppet
Is there any noticable difference to putting the 1.5x size of RAM swap file on a different HDD than the OS (specifically XP)?

Yes, you will be unable to obtain a memory dump for crash analysis.


Please search on this topic. I has probably been covered at least 20 times this year alone. Thanks.
 

Rilex

Senior member
Sep 18, 2005
447
0
0
Not only that but fragmentation (internally since it is a sparse file or externally) is irrelevant. Unless it is extremely fragmented, fragmentation will make no difference. The page file isn't sequentially read and is only read in up to 64kb chunks of data at a time.
 

TGS

Golden Member
May 3, 2005
1,849
0
0
Originally posted by: Smilin
Originally posted by: Monkey muppet
Is there any noticable difference to putting the 1.5x size of RAM swap file on a different HDD than the OS (specifically XP)?

Yes, you will be unable to obtain a memory dump for crash analysis.


Please search on this topic. I has probably been covered at least 20 times this year alone. Thanks.

You could just have two swap files, one on the OS partition and one on the second drive at a much larger size. Windows should be able to determine who has better performance(the second page file, in theory) and use that for actual paging operations. Then if you get a BSoD, you should be able to capture the dump. Viola(sic)

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Placing the swap file on a seperate partition or drive helped cut down on fragmenting (especially once the size was locked). It also allowed me to defrag my drive using the earlier "Disk Defragmenter" that came with both OSes (I'm too cheap to buy a 3rd party app), as resizing or writing to the file by the OS caused the defrag to restart from the beginning.

And it also increased seek time delays because every time the pagefile was accessed the heads would have to seek over to the other partition and then back again to get to the data.

Secondly, fixing the size seemed to cut down on delays caused by the OS inflating/deflating the file when memory demands changed.

Windows never shrinks the pagefile, it only expands it. So any delays that you accounting to the pagefile changing sizes were most likely something else.
 

TGS

Golden Member
May 3, 2005
1,849
0
0
Originally posted by: Nothinman
Placing the swap file on a seperate partition or drive helped cut down on fragmenting (especially once the size was locked). It also allowed me to defrag my drive using the earlier "Disk Defragmenter" that came with both OSes (I'm too cheap to buy a 3rd party app), as resizing or writing to the file by the OS caused the defrag to restart from the beginning.

And it also increased seek time delays because every time the pagefile was accessed the heads would have to seek over to the other partition and then back again to get to the data.

Windows XP actually moves this further to the center of the disk by default. This lowers the penalty of movement of a swap at either "end" of the disk to data on the other side.


Stolen from Microsoft:

Another advantage of using a pagefile on its own partition is that the pagefile will not become fragmented. If the pagefile is on a partition with other data, the pagefile might experience fragmentation as it expands to satisfy the extra virtual memory required. A defragmented pagefile leads to faster virtual memory access and improves the chances of capturing a dump file without significant errors.


Stolen from Microsoft:

By default, Windows puts the page file on the partition that contains the operating system. However, this placement can increase disk activity and slow performance. To allow Windows to process multiple I/O requests more efficiently, it is recommended that you put a secondary page file on a non-system partition and a separate physical disk drive if a separate hard disk drive is available. You should leave a small primary page file on the boot partition to enable Windows to create a crash dump file (Memory.dmp) in case of a kernel-mode Stop error. The crash dump file may be important for diagnostic information if the server becomes unavailable because of a Stop error.

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Windows XP actually moves this further to the center of the disk by default. This lowers the penalty of movement of a swap at either "end" of the disk to data on the other side.

Even if that's true, since you created a seperate partition for pagefile you've limited how close Windows can put the pagefile to the rest of the data on the disk.

 

TGS

Golden Member
May 3, 2005
1,849
0
0
And for some reason you know where the operating system is placing the data to begin with? Partitions are the only way you can force data sets into particular zones on the disk.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You can't guess where any paging to/from will happen reliably. If you're actually hitting the pagefile then you're surely also dropping non-modified binaries and shared-libraries so when the OS goes to page them back in it'll be jumping all over the disk because you'll be paging in data from the binaries and shared libraries, the registry, data files that are open, the pagefile itself, etc.
 

TGS

Golden Member
May 3, 2005
1,849
0
0
Again depending on partitions single or more, you cannot rely on the notion that your data will be organized in a logical manner to avoid wasted seek times. Zoning data sets by themselves is the only thing you can do to guarantee certain levels of performance. Additionally any actuator contention is going to hurt disk performance. In the typical desktop system, you are going to use paging operations. It seems a bit strange to think by making the swap on a most used partition on a disk will guarantee some performance benefit. Going back to partition setup, you have no way of guaranteeing that the data sets are any closer to the page file. Even if the page file is on the most used partition. So much administrator overhead would go into figuring average seeks from the requested data sets to paging file. How large would the partition be for acceptable performance? Could the Page File be moved closer to the outer edge for better overall performance? Is the most accessed data in a zone towards the inner portion of the disk?

A lot more has to be answered than a blanket statement of most used partition of least used disk. In the end it's debating single disk configuration and there isn't a lot of room for performance gains in that arena.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
In a lot of cases zoning data won't help performance either because you'll just end up seeking between zones which will hurt performance. And in any system you're going to use paging operations, it's the only way that the kernel knows how to get data from some medium into memory. You can tweak how the paging happens by doing things like non-buffered I/O or reading the entire file once to make sure it's in cache, but that's about it.

No administration overhead should go into this, all you should have to do is "leave it be" or if you have another physical disk to put the pagefile on that's seperate from the OS and from your data, go for it. But if the pagefile is affecting performance that much, you need to buy more memory and no amount of tweaking can change that.
 

Doom Machine

Senior member
Oct 23, 2005
346
0
0
if this was a realworld noticable performance boost, no one would argue about it. i put it on my raptor drive and still didnt notice a thing, i get exact same fps in games, os runs the same so who cares what some number in a benchmark says assuming it says any different.
 

TGS

Golden Member
May 3, 2005
1,849
0
0
The only performance "gain" is moving to another disk. The gain being, that you aren't causing performance degradation on the boot volume.

@Nothinman, I'm talking about zoning data that requires the fastest seek times to the outer edges. If you check out HDTach, you can see where a sudden drop in disk throughput comes into play. You could partition from the edge to that point where performance starts to drop off, and gaurantee you will have the fastest overall performance in that region of space. This will also force the average seeks to go down as the disk is not seeking against the entire volume. The operative word is overall, as you can never guarantee the system will only use this disk space, unless you only use the small partitioned area. Though like I said, once you start to talk about overall performance rather than significant results it's almost a moot point to tweak. Though if one was inclined there are ways off laying out data sets to get the most overall optimal performance.
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
I've put my pagefile on a floppy. I find this gives me the best performance.