Asia Travel Forum | Credit Cards | Buscador libro | Xbox Mod Chips | Server Load Balancing
Defrag question [Archive] - PCMech Forums

PDA

View Full Version : Defrag question


juppy
02-02-2003, 11:37 PM
Okay, here goes. Easy question time.

I'm using Windows 95. When I use the defrag program, it gives some options of what to defrag. Under these there is an option that says something about defragging the blank space on the hard drive. Is it really necessary to defragment the blank space? I figured if it's blank, there wasn't anything there TO defrag. Is there? Because it really slows down the process and seems to take forever when I leave this option checked. Without it (just defragging the files only) it breezes through in a short amount of time. Thanks.

Justin

GaryRouth
02-02-2003, 11:53 PM
Well, juppy, I learned something today. . . (that I never would have if you hadn't asked that question)

Looks like the reason to "defragment" blank space, according to Microsoft, is to help the swap file's performance. Here's their article: http://support.microsoft.com/default.aspx?scid=kb;en-us;240755

Actually, it's a funny question, since all defragmenting is going to rearrange free blocks that lie on the disk's heavily used outer blocks/sectors. I suppose what Microsoft means to address is the placement of the swap file: if there's more contiguous free space, the swap file can expand and contract without fragmenting itself.

The other strategy that Win95 users have is a swap file of a set size (rather than a dynamic one). I like this idea better, and it's easier on my noggin to understand. Not really sure what Microsoft is doing to make defragmenter take so long otherwise.

. . . Gary

juppy
02-03-2003, 01:34 AM
Thanks Gary.
I didn't really see why the blank stuff needed "rearranging", so to speak. I mean, if there's nothing there how do you rearrange or defrag it? :confused: I felt like it was the equivalent of someone saying "Okay, you got to keep yer chocolate milk stirred or it'll separate. Now here's an empty glass; ya need to stir the nothing in that glass too." Why stir the air, know what I mean? That link sorta cleared it up though, I may re-read it again tomorrow as I'm really beat tonight. Been helping my bro work on mom's car all day. Was going to have to put a whole bunch of stuff in the bottom of the engine but we finally figured out we'd be further ahead to just long block it and be done with it. Thanks again Gary.

Nuclear Krusader
02-03-2003, 02:18 AM
I recently read in the PCW magazine that you can speed the defrag proccess by temporarily removing the swap file, then reactivating it after the defrag was done. What do you think about this?

GaryRouth
02-03-2003, 02:40 AM
Nuke - I seem to remember something like that too. But I don't remember what versions of Windows they were referring to. Seems like it was a trick to defrag the swap file itself?

I also remember that at the end of the article, they mention that most 3rd party defragmenters can defragment the swap file, so that their trick isn't necessary when those are used. Just out of curiousity, I looked over a PC Magazine (where I thought I'd seen an article like that one), but could only come up with this one, from Alfred Poor's 2/26/2002 column:
__________
"Is it best to let Windows manage my virtual-memory settings, or is there some other configuration that gives better performance?

This is one of many topics where well-informed people can reasonably disagree. Here's my answer.

The most important way to increase virtual-memory performance in Windows is to require as little disk head movement as possible. You can accomplish this with several strategies. First, create the virtual-memory file on a defragmented partition, so that the file will be contiguous. Next, set the file to a fixed size—by setting the minimum and maximum sizes to the same value—so that Windows doesn't waste time dynamically changing the swap-file size.

Of course, the best solution of all is to add enough real memory that Windows never has to resort to virtual memory. This will give the best performance."
__________

I think most of us nowadays have systems with more than adequate memory & the page file issue is not as important as it once was.
. . . Gary

TwoRails
02-03-2003, 11:34 AM
Originally posted by GaryRouth
I think most of us nowadays have systems with more than adequate memory & the page file issue is not as important as it once was.
. . . Gary

I go along with that 100%!

I've been using Norton Utilities for so may years that I sometimes for get about this stuff.

First (only because it's the shortest), on the Min / Max thing: I do use the Min, as there really is much less fragmentation. But, every time I've tried the Max, I've run into unstability that goes away after I remove the Max. (No, not trying to start a Min/Max "war" -- just sharing my experience..)

Now, one reason I like Norton Utilities is that it does "optimize" the swap file, which means it moves it to the front of 'C' drive. This, and with a Min setting, is good for me.

Another reason is that Norton's defragger shows different types of files as different types of colors !!!! This is extremly helpful in determining the Min size. If you fire-up the defragger, and you see that special color scattered all over your 'C' drive (as well as the section in the front of the drive) then the Min is not set high enough for your system. Increase the Min setting so that you see only the special color in the front of the drive, all in one block.

This works the best, and is the easiest. This way, it's Tuned to how you use the system. I do games and both still and video editing and never have a fragmented swap file.

HTH

TwoRails :D

galaxian
02-03-2003, 11:58 AM
You really want to have defrag consolidate free space as part of the run.
Otherwise you will end up with a disk that is unfragmented, but has many pieces of free space scattered throughout.

Then, as files are created and written, windows will start to allocate free space to them. And, guess what the result will be?
New files that potentially are fragmented, with their pieces scatter thoughout the drive.

A fragmented swapfile is really not a performance issue. All I/O to the swapfile is done in 4K chunks, and there is no readahead involved, since the next piece to be swapped in, is not necessarily beside the last one. The Norton optimization improvements, by moving it to the front of the drive, come from the speed of access (on the faster portion of the disk) as opposed to having it unfragmented.

In the case of a "normal" file, having the data for the next read sitting beside the data for the previous read (in an unfragmented file) means that more than one record will be read on the same pass of the disk. Thus, improving performance.

TwoRails
02-03-2003, 02:05 PM
Hi galaxian and Everybody,

Interesting post, galaxian, but I'm unclear on some things:

Originally posted by galaxian
You really want to have defrag consolidate free space as part of the run. Otherwise you will end up with a disk that is unfragmented, but has many pieces of free space scattered throughout.

Then, as files are created and written, windows will start to allocate free space to them. And, guess what the result will be? New files that potentially are fragmented, with their pieces scatter throughout the drive.
Having used graphical defraggers for many years, ones that show file /disk usage and individual files with a click of a mouse, I have never seen this. I defrag often, and have never seen little bits and pieces of files just scattered throughout the drive. They are all very close to the front of the drive, even if fragmented. So, if I have, say 6 gigs of data on a 18 gig drive, all files are within the approximately first third of the drive. There may be holes, but the files are not scattered into the second 1/3, or the last 1/3.

A fragmented swap file is really not a performance issue. All I/O to the swap file is done in 4K chunks, and there is no readahead involved, since the next piece to be swapped in, is not necessarily beside the last one.
I believe all fragmentation is a performance issue. If the head have to jump from the front of the HD, then to the back of the 6 gigs mentioned above, then back again, it takes longer. Also, I was unaware of Windows treating the Swap File, which is just a file, different than any other file in regards to reading cluster sizes, or just grabbing a 4 K chunk out of a, say, 32 K cluster.

In the case of a "normal" file, having the data for the next read sitting beside the data for the previous read (in an unfragmented file) means that more than one record will be read on the same pass of the disk. Thus, improving performance.

Agreed, for some files like a jpeg. For Random Access, such as in data bases, the email one reads, check book programs, etc., the next record to read is vary rarely the next record physically stored on a HD. It may be at the end of the file many Megabytes or Gigaytes away, then the next record might be physically at the beginning of the file, and so on.

TwoRails

galaxian
02-03-2003, 07:49 PM
I didn't mean to imply "throughout the drive". The answer was in regard to the question about whether they should defrag the free space or not.

For example, if you looked graphically at a disk that hadn't been defragged for a while, you would free space scattered throughout the files.
If you run just a defrag of the files, defrag will perform that exercise and not care about free space consolidation. (I think this option was only available on Win95 anyway).
Now, if you look at the disk graphically, you will see a "similar" picture with the free space scattered throughout, with the difference being that all the files are now unfragmented.

When free space is part of the defrag, the files are all packed together as tightly as possible, forcing all the free space to be consolidated at the end of the files.

Re: Swapfile
Windows still needs to read the disk at the cluster level. Ie: the disk will process the 32K cluster, if that is the size. But, the only data that it is using is a 4K chunk to page in a piece of ram.

As for the heads moving around, remember that in between windows performing a swap in request, any other program (including another windows process) could also be making a read/write request that will be honored, and that will result in the heads moving away from wherever the swap I/O came from.

TwoRails
02-03-2003, 08:46 PM
Hi galaxian and Everybody,

I see now what you meant about the "throughout" thing. Since I've only used 3rd party defragers for as long as I can remember, I've always done it this way. And you're right, at least with Win 98.2's defrager, as I just opened it up and there is no option for this.

About the 4K data thing, we agree on that, too. It's just like a database that has only "Age" and "Sex" fields, the system has to read the whole 32K cluster to get just those few bytes of information.

TwoRails