How much room to allocate for swap file?

  • Thread starter Thread starter Howard J
  • Start date Start date
H

Howard J

A possibility for a computer that's to be built is to partition the
drive(s). (Ref: http://www.aumha.org/win5/a/xpvm.htm and
http://www.aumha.org/a/parts.htm .) It seems that this could help with a
number of problems including fragmentation. If one were to place the Swap
File / Pagefile on a partition, what might a good size be for handling up to
3 or so hours of continuous recording (and then for handling editing of such
a file)? Would it be best to let MovieMaker chop such a file up afterward
(select scenes automatically) so as to avoid having a large file? Thanks!
 
Hello there,

Unless you actually cut a file with MM2 and then discard one piece and save
the other you will not see separate files.

MM2 when it imports a video will create an internal reference file that
contains markers showing where there has been a change in scene or whatever.
These markers are displayed as a list giving you start and stop times
relative to the very beginning of the file and a duration, the difference
between the first two mentioned times.

Splitting a large hard drive is a useful way of avoiding fragmentation
within a captured file...however, you need to consider how far the heads
have to travel in order to reach that section of the drive...with today's
modern drives its not so much of a problem as it used to be. My solution was
to purchase a second EIDE card capable of Mode 6 data transmission and plug
a 40GB drive into that. This means that the data for the capture does not go
through the same EIDE card and that means a marginal increase in speed
generally. Because drives are relatively slow compared to the bus, the first
EIDE card can handle its set of instructions, and, data that would have been
held up for the capture file sails straight on to the new card and then
drive.

I have tried placing my swap file on other partitions and other drives. I am
sure their is an increase in efficiency, when its on a separate and distinct
drive, but the only time you would see that gain, and the same applies to my
remarks above, is when say your Drive C: is also being written too.
 
There's a link about 1/2 way down my Problem Solving.. Checklist page, an
article 'Optimize Virtual Memory for Performance'. My personal rule of thumb
is 3 times the physical RAM.
 
Keep in mind that as memory has gotten cheaper and people have gotten
machines with more memory, it might be necessary to re-evaluate such
heuristics. I've got 1GB of RAM on my machine, so 3 times that would give
me 3GB of swap. Without extra effort, 32-bit versions of Windows can only
address 2GB (the other 2GB of address space is reserved for the OS); thus
I've wasted 1GB of disk space.

If you want to get a more accurate figure for your particular situation,
bring up the Task Manager and click to the "Performance" tab. In the
"Commit Charge" area, the value of "Limit" shouldn't be too much larger than
"Peak". If your "Peak" value is significantly below "Total" (in the
"Physical Memory" area), you might not need any swap file at all.

Dan
 
Dan,

I'd like to explore this further and end up with something on the website
that offers better guidance, tailored of course for users of Movie Maker 2.
The article that I point people to wasn't written with video editing in
mind.

On my laptop, I'm looking at numbers of 1280320 K Limit and 313380 Peak, so
my Limit is a lot higher than my Peak. What does the Peak number mean?

PapaJohn

J. Daniel Smith said:
Keep in mind that as memory has gotten cheaper and people have gotten
machines with more memory, it might be necessary to re-evaluate such
heuristics. I've got 1GB of RAM on my machine, so 3 times that would give
me 3GB of swap. Without extra effort, 32-bit versions of Windows can only
address 2GB (the other 2GB of address space is reserved for the OS); thus
I've wasted 1GB of disk space.

If you want to get a more accurate figure for your particular situation,
bring up the Task Manager and click to the "Performance" tab. In the
"Commit Charge" area, the value of "Limit" shouldn't be too much larger than
"Peak". If your "Peak" value is significantly below "Total" (in the
"Physical Memory" area), you might not need any swap file at all.

Dan
 
Dan,

The help file says the Peak is the maximum since the processor started. I
assume that's since I last turned on the computer, not since day one of the
laptop's life. But that's looking backwards, as I haven't done any movie
projects today yet... and I'm wanting to set virtual memory so it's optimum
for when I do movies and need it.

With my computers having 512 MB of RAM and 3x that for swap files, I guess
I'm not wasting any space - unless I really don't need that much swap file
space.

PapaJohn
 
Do some (extreme) video editing and then look at the "Peak" value (w/o
shutting off your computer! :-) ). Then you can adjust your swap so that
"Limit" isn't too much above this value. I suspect that in your case, you
may already be there since you reguarlly edit video.

And in these days of 200GB disks, 1GB wasted really isn't that big of a deal
either...so your heurisitic can still be acceptable, as long as people are
aware of the tradeoffs. It sure is a lot easier to tell somebody "if you've
got lots of disk space, set your swap to 3 times RAM" than to have to look
though values in the task manager.

Also, as the transition to 64-bit machines begins, it will once again be
necessary to correctly configure swap space (no 2GB address space limit).
While I haven't tried anything out, your "3 times" rule strikes me as as
being a good balance between using available disk/memory resources while not
making so much swap available that you begin to thrash (the OS spends all of
it's time moving memory pages between RAM and disk that it has little time
for anything else).

Dan
 
Hi there,

Also, as the transition to 64-bit machines begins, it will once again be
necessary to correctly configure swap space (no 2GB address space limit).
While I haven't tried anything out, your "3 times" rule strikes me as as
being a good balance between using available disk/memory resources while
not
making so much swap available that you begin to thrash (the OS spends all
of
it's time moving memory pages between RAM and disk that it has little time
for anything else).

I thought I should point out to you both that disk thrashing, in terms of
swap files, it can of course occur with any file of significant size, is a
direct result of not having enough swap file space rather than having too
much, and even then, disk thrashing will only occur if the swap file is
heavily fragmented and there are in terms of the radius of the disk, large
gaps between those fragmented sections. This is an issue that only occurs to
any significant degree on single striped disks...on RAID systems where there
can be multiple strips and mirroring this hardly ever occurs.
 
I hope you guys can come to a good final recommendation for the size of swap
files.

Both RAM and hard drive space is becoming cheap. In my case, I have 2 GB of
RAM and a 200 GB hard drive.

I'm interested in how big a swap file I should create (in it's own
partition, to prevent fragmentation).

I could create 10 gig swap file but no sense in doing that if XPPro cannot
address it.

From what Dan wrote, 32 bit WinXP can address 4 GB. So, should my swap file
be 2GB? or is 3 times my RAM still a good advice?
 
Hi again,

I should have also mentioned the cluster size on the drive/partition that
contains the swap file meant to be on its own.

When you format with NTFS, XP will make the Unit size 4K...this is no good
at all, you should go for the highest which is 64K.

Reasons.........put a 1K file on a 4K Unit...you lose 3K...sounds a lot, but
that's as good as it gets....now put a 1Meg file onto 4K Unit and the file
will appear to be larger than 1Meg...Reason is, there are bytes of info at
the beginning and end of each Unit that tell NTFS where the next cluster is
in the sequence...and that takes computing time as well as drive
space....how do you reduce the overhead...easy...make the Units as large as
possible, this not only saves space when your average file is quite large
but it also reduces the number of occasions the Hard drive firmware has to
look for the next available Unit...and this equals faster throughput.

So, if you are going to put a swap file onto a partition just large enough
to hold that file, or if you are going to put the swap file onto a hard
drive that is mainly used for large files....reformat it using the disk
manager in XP (Via My Computer > Manage etc) and make sure that the
Allocation Unit size is 64K (currently the largest allowed on 32bit
drives/machines)
 
So, if you are going to put a swap file onto a partition just large enough
to hold that file, or if you are going to put the swap file onto a hard
drive that is mainly used for large files....reformat it using the disk
manager in XP (Via My Computer > Manage etc) and make sure that the
Allocation Unit size is 64K (currently the largest allowed on 32bit
drives/machines)

I checked (using CHKDSK) that the cluster size is indeed 4K. I'll remove
the swap file and re-format the drive soon.
 
Back
Top