Author Topic: Defrag swap space in XP  (Read 8369 times)

0 Members and 1 Guest are viewing this topic.

Offline robrenzTopic starter

  • Super Contributor
  • ***
  • Posts: 3035
  • Country: us
  • Real Machinist, Wannabe EE
Defrag swap space in XP
« on: March 30, 2012, 03:19:18 pm »
When I defrag my hard drive there is the protected swap space that does not get defragged. After 5 years the swap space is extremely fragmented and I can tell performance of my dell workstation is hampered.  Is there a way to defrag the swap space other than a total disk format and reload all software and files again?

Offline SoftwareSamurai

  • Regular Contributor
  • *
  • Posts: 170
  • Country: us
Re: Defrag swap space in XP
« Reply #1 on: March 30, 2012, 03:38:08 pm »
 

Offline Lightages

  • Supporter
  • ****
  • Posts: 4313
  • Country: ca
  • Canadian po
Re: Defrag swap space in XP
« Reply #2 on: March 30, 2012, 03:45:20 pm »
Although this is an electronics forum and not a computer support forum, I guess I will step in and help :)

You need to right click on My Computer then click on Properties/Advanced Tab/Performance Settings button/ Advanced Tab/Virtual Memory Change button. Then click on No paging file. Reboot, delete the pagefile, run your favorite defrag program. Once completed, do not do anything else except make a "Custom size:" paging file. Set the minimum to at least 2048 and a maximum of 4095. Once this is done, windows will build a new paging file that is contiguous and it will not fragment again.
« Last Edit: March 30, 2012, 06:14:14 pm by Lightages »
 

Offline robrenzTopic starter

  • Super Contributor
  • ***
  • Posts: 3035
  • Country: us
  • Real Machinist, Wannabe EE
Re: Defrag swap space in XP
« Reply #3 on: March 30, 2012, 03:53:56 pm »
Thanks for making an exception :)  In your instructons can I use the standard windows defrag that I have been using or do I need a second source defrag to work?  Thanks again for your help.

Offline grenert

  • Frequent Contributor
  • **
  • Posts: 448
Re: Defrag swap space in XP
« Reply #4 on: March 30, 2012, 04:04:25 pm »
I use Raxco Perfectdisk, and it will defrag your swap files as well as other system files.  It is pretty cheap ($25) and you can download a trial version to see if it improves the performance of your computer.
 

Offline sonicj

  • Frequent Contributor
  • **
  • Posts: 756
  • Country: us
  • updata successed!
Re: Defrag swap space in XP
« Reply #5 on: March 30, 2012, 04:07:01 pm »
i like mydefrag.
 

Offline Deepak

  • Regular Contributor
  • *
  • Posts: 76
  • Country: us
Re: Defrag swap space in XP
« Reply #6 on: March 30, 2012, 04:24:35 pm »
Thanks for making an exception :)  In your instructons can I use the standard windows defrag that I have been using or do I need a second source defrag to work?  Thanks again for your help.

Standard tools are fine. Here's a detailed guide if you need it:

http://windowsdevcenter.com/pub/a/windows/2004/11/23/defrag_pagefile.html
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7990
  • Country: gb
Re: Defrag swap space in XP
« Reply #7 on: March 30, 2012, 04:30:53 pm »
Disable pagefile, reboot, delete pagefile, defrag, enable pagefile at a fixed size. It will never become fragmented again.
 

Online mariush

  • Super Contributor
  • ***
  • Posts: 4983
  • Country: ro
  • .
Re: Defrag swap space in XP
« Reply #8 on: March 30, 2012, 04:46:30 pm »
I'm using O&O Defrag.

Go and set the pagefile to a fixed size, reboot and windows will create a new pagefile. Then defrag and o&o defrag will move the whole continuous page file at the start of the drive.

As it's fixed size, windows will never move it from that spot ever.

2-4 GB is plenty of page file, no need to set a bigger one.

 

Offline Sionyn

  • Frequent Contributor
  • **
  • Posts: 848
  • Country: gb
Re: Defrag swap space in XP
« Reply #9 on: March 30, 2012, 08:07:49 pm »
check out vopt
eecs guy
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: Defrag swap space in XP
« Reply #10 on: March 30, 2012, 08:55:37 pm »
How many HD do you have there ? Or if you HD has more than 1 partitions, then the fastest, easiest and cleanest way to defrag the page file (swap file) is to disable the swap file by setting it to 0 (zero) on the current boot drive/partition. Then again set the swap fle at other drive/partition just for temporary.

This will effectively clean your from drive from swap file without any hassle, and from here launch your favorite defragger and if it has an option to defrag + to make contiguous free space, choose this option and use it, this will defrag those ordinary files easily without that big chunks of swap file. Once the defragger finished the job, move back the swap file back to the previous drive/partition and don't forget to disable (set to zero) at that temporary disk/partition.

The newly create swap file on the fresh defragged drive will occupy the freed contiguous free space without any defragmentation, and although it sounds complicated, this will beat any defragger out there in term of speed & quality of the swap file defragmentation.

Also to avoid further defragmentation in the future, set the minimum and maximum size to equal, this will set the page file permanently at the place where it was created from the 1st time, and it won't grow anymore causing defragmentation in the future. If you don't use heavy memory programs and have say 4 or 8 GB of memory, "usually" a fixed page file size of 4096 MB or 8192 MB is more than enough.
« Last Edit: March 30, 2012, 09:04:08 pm by BravoV »
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Defrag swap space in XP
« Reply #11 on: March 30, 2012, 08:56:55 pm »
lightags, a better method is to make a paging files max and min the same, that way windows doesnt go resizing it and it will not fragment, it also helps a little on mechanical hard drives as windows wont be screwing around adding and removing chunks of itself,
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: Defrag swap space in XP
« Reply #12 on: March 30, 2012, 09:32:52 pm »
You can run without a pagefile entirely, but the PC will BSOD when it runs out of ram.

Guy i know with 12GB of ram has no pagefile and has never had any issue since he did it 2 years ago.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline G7PSK

  • Super Contributor
  • ***
  • Posts: 3859
  • Country: gb
  • It is hot until proved not.
Re: Defrag swap space in XP
« Reply #13 on: March 30, 2012, 09:41:05 pm »
Auslogics defrag is very good they also do a page defrag version.
 

Offline benemorius

  • Regular Contributor
  • *
  • Posts: 173
Re: Defrag swap space in XP
« Reply #14 on: March 30, 2012, 10:02:22 pm »
This is offtopic of course, but you might want to consider that the fact that your swap space is being used at all is not ideal. Adding some ram would be a far more effective fix than defragmenting the swap file. Some 10 years ago virtual memory was just a fact of life, but the days of expensive ram are behind us now.
« Last Edit: March 30, 2012, 11:16:24 pm by benemorius »
 

Offline Deepak

  • Regular Contributor
  • *
  • Posts: 76
  • Country: us
Re: Defrag swap space in XP
« Reply #15 on: March 31, 2012, 12:01:34 am »
This is offtopic of course, but you might want to consider that the fact that your swap space is being used at all is not ideal. Adding some ram would be a far more effective fix than defragmenting the swap file. Some 10 years ago virtual memory was just a fact of life, but the days of expensive ram are behind us now.

Having the swap is ideal because the OS was designed to have it.

Ram is cheap, so the classic concerns about not having enough room for your programs are somewhat lessened. Some programs do act delinquently so a little insurance can't hurt since disk is even cheaper.

One thing to keep in mind is that the amount of memory programs request can often end up being much more than they actually use. If you only have ram then all of the committed (but unused) memory needs to be reserved and cannot be allocated for anything else. If swap exists then the commits can be reserved on disk without a penalty since nothing is actually occupying that memory.

The obvious response is 'who cares? I already have more than enough ram for my programs.'

The thing is that uncommitted ram can be used for file caching, which can be a huge factor on performance, so by having your unused ram also be uncommitted you're getting the most out of the resources you have on hand. There's always some upper limit on how much ram you can get without upgrading boards or getting prohibitively expensive, and so when keeping the hardware invariant having swap is always better (especially when you don't use it!)
 

Offline Lightages

  • Supporter
  • ****
  • Posts: 4313
  • Country: ca
  • Canadian po
Re: Defrag swap space in XP
« Reply #16 on: March 31, 2012, 12:05:06 am »
lightags, a better method is to make a paging files max and min the same, that way windows doesnt go resizing it and it will not fragment, it also helps a little on mechanical hard drives as windows wont be screwing around adding and removing chunks of itself,

You are correct. I was thinking still of the days I assisted people who ran XP and some had rather small hard drives so there was an incentive to keep the swap file smaller.
 

Offline benemorius

  • Regular Contributor
  • *
  • Posts: 173
Re: Defrag swap space in XP
« Reply #17 on: March 31, 2012, 12:52:01 am »
This is offtopic of course, but you might want to consider that the fact that your swap space is being used at all is not ideal. Adding some ram would be a far more effective fix than defragmenting the swap file. Some 10 years ago virtual memory was just a fact of life, but the days of expensive ram are behind us now.

Having the swap is ideal because the OS was designed to have it.


Having some configured is ideal; using it is not.

The suggestion to take home is not that you should configure your system for no page file, but instead that you should ensure that you have enough ram for the amount of multitasking you commonly do so that actual swap use is not a regular occurrence. Needing to go out to ram to find your data is bad enough, but having to go all the way to a mechanical hard drive to fetch memory is completely insane.

If you're noticing the performance hit of swap use, that's a sure sign that a ram upgrade would result in a perceptible increase in performance. For a much more empirical indication, I'm sure that the task manager in windows will show how much swap is in use. It's normal to see a small amount always in use, but regularly seeing more than a few hundred megs is indicative of actual swap use which could be avoided.


Some programs do act delinquently so a little insurance can't hurt since disk is even cheaper.

Quoted for truth! For several years I ran a desktop (which admittedly had greatly more ram than I needed at the time) without a swap partition and the only time the ram came anywhere close to 0% free was during and after long rsync operations. Life was good, but then one day I started using google chrome. A month or two later it had gobbled up some 5 or 6 gigs of ram and I woke up one morning to find x in a partially crashed and unrecoverable state.

I still can't be bothered to devote a whole damn partition to swap, but I certainly do keep a swap file now for when accidents like this occur. Since then it has saved me from countless dozens of similar bad days.
 

Offline robrenzTopic starter

  • Super Contributor
  • ***
  • Posts: 3035
  • Country: us
  • Real Machinist, Wannabe EE
Re: Defrag swap space in XP
« Reply #18 on: March 31, 2012, 12:56:28 am »
Thanks everyone for all the help.   I am good so far except I can't find the pagefile to delete it.  :-[ Is named pagefile? because a search for pagefile* does not show anything. I have "show hidden files" set in all folders. My C drive is my system drive and it is not shown. Is it in a sub folder in C? Thanks again.

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: Defrag swap space in XP
« Reply #19 on: March 31, 2012, 01:03:59 am »
Thanks everyone for all the help.   I am good so far except I can't find the pagefile to delete it.  :-[ Is named pagefile? because a search for pagefile* does not show anything. I have "show hidden files" set in all folders. My C drive is my system drive and it is not shown. Is it in a sub folder in C? Thanks again.

You have to go one step further than 'show hidden files', you need to untick 'Hide protected operating system files'.

Most of the time you will find pagefile.sys it in the root of your main disk.
« Last Edit: March 31, 2012, 01:05:31 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16272
  • Country: za
Re: Defrag swap space in XP
« Reply #20 on: March 31, 2012, 11:23:10 am »
Pagefile should be fixed in size, preferably to 2.5 times physical memory ( worked from win9x, and still works well) and should be contiguous. As well look at the Microsoft Sysinternals site ( good set of really fast, do as they say and work totally inside windows with the cost of free being the best tools) and install the registry defragger, as this will make a difference on the way windows runs.

Swapfile for me is a partition, and is much bigger than main memory ( 3 times in my case) as then hibernation is faster and will work. I did use an old small SCSI drive as dedicated swap file until it eventually died, as it was a non contented bus that improved operation.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf