Help with the Windows 7 swap file.

C

Char Jackson

Hi Rich! Oh back in the early days (in the 80's), RamDisks were
wonderful! As drive speeds were so slow and pokey. Even the Windows 98
StartUp disc uses a RamDisk. It is quite useful. True, the W98 StartUp
loads up DOS with a RamDisk. And earlier versions of DOS also was helped
with one as well.

Some people thinks today RamDisks have no use. And while it is true
Windows virtual memory is very much like an automatic RamDisk in many
ways. So adding another RamDisk really shouldn't help much if any at
all.

But that isn't true for all setups today. As some systems use SSD as
drives. And writing to SSD excessively shortens their life. So I often
move the temp files to a RamDrive. And if I am using a swapfile, I move
that too to the RamDrive. I also have cut down other Windows writing too
on the SSD.

And by doing so, I have figured out based on the little amount of
writing, my SSD will last about 8,000 years from what I recall. Yeah a
bit of overkill I agree. But if you make no changes at all, you can
waste a SSD in as short as 2 years.
I used to think the same thing, but someone posted a link to an
article recently where it was shown that statistically SSD's have a
much longer life than conventional hard drives, even before you do any
of the things you mentioned above, making those steps unnecessary.
Unfortunately, I don't think I saved the link, but it was an
interesting read.
 
B

BillW50

In
R. C. White said:
Hi, Peter.

The swap file - also known as the page file or paging file, or as
virtual memory - is not very well understood by most computer users.
One of the best articles on the subject was written by MVP Alex
Nichol, but he died in 2005, while Vista was still in beta and long
before Windows 7. While that article focuses on WinXP, and some
details of the user interface have changed since then, the
fundamentals have not changed and we can still learn a lot from that
explanation: http://www.aumha.org/win5/a/xpvm.htm

A key paragraph from that article applies to your question:
<quote>
Why is there so little Free RAM?
Windows will always try to find some use for all of RAM - even a
trivial one. If nothing else it will retain code of programs in RAM
after they exit, in case they are needed again. Anything left over
will be used to cache further files - just in case they are needed.
But these uses will be dropped instantly should some other use come
along. Thus there should rarely be any significant amount of RAM
'free'. That term is a misnomer - it ought to be 'RAM for which
Windows can currently find no possible use'. The adage is: 'Free RAM
is wasted RAM'. Programs that purport to 'manage' or 'free up' RAM
are pandering to a delusion that only such 'Free' RAM is available
for fresh uses. That is not true, and these programs often result in
reduced performance and may result in run-away growth of the page


The more RAM you get, the more of it will be "wasted", to use your
term. And see the paragraph, "Can the Virtual Memory be turned off on
a really large machine?", in Alex's article. I used RAM disks a lot
and loved them - but that was back in DOS days and even in early
Windows, as I recall. (Remember the days of "expanded RAM" v.
"extended RAM", and using DesqView and other RAM managers?) But that
was when 1 MB was a lot of RAM and 1 GB was almost unimaginable.
Nowadays, all a RAM disk does in most cases is use up RAM that could
be used more efficiently - if needed at all - by the page file.

If you insist on managing the swap file yourself, you can do it easily
(after a long click-path to find the page):
Start | Control Panel | System | Advanced system settings (furnish
Administrator credentials) | Advanced tab, Performance / Settings |
Advanced tab | Virtual memory / Change

Finally!

This page can be tricky. But you can choose from 3 "radio buttons":
Custom size, System managed size, or No paging file. Unless you
actually understand this subject, I recommend you let the system
manage it. You need to understand WHAT you are doing and, more
importantly, WHY you are doing it. I have 4 hard disks with a dozen
or so partitions and 8 GB RAM. I let the System manage my page file
- and it does it very well. Just set it and forget it.

I agree with Char: "I'm not seeing a problem."
Well I learned all about Windows virtual memory back in the Windows 3.1
days. And it still basically works the same way today. And I always
thought of it very much like an automatic RamDrive. So adding a RamDisk
which you normally have to use manually, really doesn't make a lot of
sense since Windows is using an automatic one anyway.

Although under certain conditions today, you might want to use one. The
*big* reason I can think of is when you turn off your pagefile (in an
effect, turning off virtual memory). So why on Earth would one want to
do this for?

Simple, SSDs wears out with X-amount of write cycles. So you want to
limit the amount of unnecessary writes to a SSD. And having a pagefile,
is a huge hit on the SSD write cycles. So it is best to move it
somewhere else or just to turn it off (if you have enough RAM). And this
is what I do, is to turn it off on SSD equipped machines.

And I still use a RamDisk too. As I throw all of the temps in there by
telling Windows to use the RamDisk instead. And it works very well under
these conditions.

I have monitored a stock XP system and just using it light duty for
about 12 hours, XP can often make 5GB worth of writes to the drive in
this time. That is huge! Lots of that are temps and the swapfile though.
Knocking those out and stopping Windows from updating the last time a
file gets accessed, I have tamed Windows down to about 200MB worth of
writes in a 12 hour period. This is a huge difference!
 
B

BillW50

In
Char said:
I used to think the same thing, but someone posted a link to an
article recently where it was shown that statistically SSD's have a
much longer life than conventional hard drives, even before you do any
of the things you mentioned above, making those steps unnecessary.
Unfortunately, I don't think I saved the link, but it was an
interesting read.
Well I have studied this before and I too have read an article that
might have been the same one (it said SSDs last about 127 years if I
recall correctly). But there are lots of factors here. I'll mention the
worst case that I can think of first.

I know one guy who complained to me that he was using flash drives (same
memory used in SSDs) for virtual machines and other OSs. I personally
think he has lots of patience for one, since cheap flash drives are
really slow. But his complaint was that he burns them out in about 2
months. The worse case was one burned out in 2 weeks. So how could this
be?

Easy, what he was doing was tons of writing on small cheap flash drives.
This is the worst case you can get. And they won't last very long under
these conditions. Here is what I recall about longevity.

MLC = 2,000 to 10,000 writes
SLC = 100,000 or better

Just the type of SSD (or flash memory) makes a huge difference in how
long they will last. SLC type used to be very common in SSDs. As MLC
would not last long back then in a SSD for an OS like Windows.

But things are a bit different in the last few years. MLC type used to
be super slow writers back then too. But they improved those speeds a
lot and improved how many writes they can handle. So there are more MLC
today in SSDs then ever before. Another nice thing is, they are at least
half the price of a SLC type.

Now take something small like a 4GB SSD. I actually have two of them (my
smallest SSDs). And let's say I wrote 80GB per day on it (yes that is
very excessive, but could probably be done). I figured it would last
about 2 years and that is all.

But most users would only write about a twentieth of that. So what is
that, like 40 years? Perfectly acceptable I would think, since hard
drives MTBF is like 37 years. But this is for SLC SSD types. Using a MLC
type, it would drop down to about 4 years. Well 4 years per SSD doesn't
sound too hot to me. How about you?

Now remember this is just talking about a 4GB SSD. Most people don't run
Windows on such a small system (XP fits, but you can't install all of
the updates). Most people would probably go 64GB, 128GB, or something
around these figures anyway.

So taking the 4 year 4GB SSD case and doing the same amount of writing
on a 64GB SSD would last about 64 years. I am doing all of these numbers
in my head, so I should be pretty close in my figures. And you should
get the idea how all of this works and how much the extremes can be.
 
B

BillW50

In
Gordon said:
May I ask what seems to be causing this total and ridiculous paranoia?
Well having worked in the commercial market, I know some are really
picky about security. Say for example, Coke doesn't ever want anybody
else know about its formula (they probably only keep it on paper locked
in a mega-safe). Then there are companies like Sony who recently had
their Play Station database hacked into (you think it was on Linux
server perhaps?) that doesn't know squat about security.
 
C

Char Jackson

In

Well I have studied this before and I too have read an article that
might have been the same one (it said SSDs last about 127 years if I
recall correctly). But there are lots of factors here. I'll mention the
worst case that I can think of first.

I know one guy who complained to me that he was using flash drives (same
memory used in SSDs) for virtual machines and other OSs. I personally
think he has lots of patience for one, since cheap flash drives are
really slow. But his complaint was that he burns them out in about 2
months. The worse case was one burned out in 2 weeks. So how could this
be?

Easy, what he was doing was tons of writing on small cheap flash drives.
This is the worst case you can get. And they won't last very long under
these conditions. Here is what I recall about longevity.

MLC = 2,000 to 10,000 writes
SLC = 100,000 or better

Just the type of SSD (or flash memory) makes a huge difference in how
long they will last. SLC type used to be very common in SSDs. As MLC
would not last long back then in a SSD for an OS like Windows.

But things are a bit different in the last few years. MLC type used to
be super slow writers back then too. But they improved those speeds a
lot and improved how many writes they can handle. So there are more MLC
today in SSDs then ever before. Another nice thing is, they are at least
half the price of a SLC type.

Now take something small like a 4GB SSD. I actually have two of them (my
smallest SSDs). And let's say I wrote 80GB per day on it (yes that is
very excessive, but could probably be done). I figured it would last
about 2 years and that is all.

But most users would only write about a twentieth of that. So what is
that, like 40 years? Perfectly acceptable I would think, since hard
drives MTBF is like 37 years. But this is for SLC SSD types. Using a MLC
type, it would drop down to about 4 years. Well 4 years per SSD doesn't
sound too hot to me. How about you?

Now remember this is just talking about a 4GB SSD. Most people don't run
Windows on such a small system (XP fits, but you can't install all of
the updates). Most people would probably go 64GB, 128GB, or something
around these figures anyway.

So taking the 4 year 4GB SSD case and doing the same amount of writing
on a 64GB SSD would last about 64 years. I am doing all of these numbers
in my head, so I should be pretty close in my figures. And you should
get the idea how all of this works and how much the extremes can be.
I don't have the energy to validate your numbers, but a 64GB SSD
lasting 64 years seems pretty good to me. By comparison, the average
life of a hard drive is about 7 years, right? I know you said 37 years
above, but I believe that's a typo.
 
B

BillW50

In
Char said:
I don't have the energy to validate your numbers, but a 64GB SSD
lasting 64 years seems pretty good to me. By comparison, the average
life of a hard drive is about 7 years, right? I know you said 37 years
above, but I believe that's a typo.
Well no problem. SSD longevity varies a lot by how much you write per
day, the size and the type of SSD. I was cutting back how much I write
and I figured out that it would take 4,000 (or was it 8,000) years to
burn it out. And I thought that was crazy. Why be so careful? As who
would care to use such a SSD in 10 years, let alone in 4,000 or more
years, right?

An average hard drive lasting 7 years? Well the article I read said 37
years. And to be honest, back in the 80's I was using MFM hard drives
and they were awful! If you got more than a few years out of them you
were doing really well.

When the beginning of the 90's started, we had something new called IDE
hard drives. Boy were they nice! It didn't seem that way at first as the
first one I got failed in a week (this was a 2.5 inch drive btw). I got
a replacement and it had a sticker that said Prototype! I called up and
complained. It even had bad sectors on it. The engineer (they had
engineers answering the phones back then) asked if anymore bad sector
showed up? And I said no. And he said don't call me again until they do.
And I fired it up a few years ago and it was still working just like
that first day. ;-)

I dunno, I have had failed IDE drives since then. But it seems if they
can made it past 6 months, they are good to go. I would guess and say my
failure rate was under 10%. And the rest are still working just fine.
And I think that is very good if you ask me. Far better than the old MFM
days anyway. Heck are there any MFM drives still running today?
 
S

Sunny Bard

BillW50 said:
writing to SSD excessively shortens their life. So I often
move the temp files to a RamDrive.
Makes sense, though wear-levelling should be your friend.
And if I am using a swapfile, I move that too to the RamDrive.
Not so sure about that ... you have a swapfile for windows to use when
it's short of memory, then you ensure that windows has less memory
available by using some of it for a ramdisk to store the pagefile on?

I can see if you're in some sort of boundary case (e.g approaching the
3.whatever GB limit on a 32bit O/S) it might help, but not as much as
upgrading to a 64bit O/S would.
 
R

Rich

I think I set my Temp file to a RamDrive when I was playing around with
RamDisk about 10 years ago. I seem to remember having a problem when
installing a program, or something like that, which required a reboot &
failed when the program searched the now newly reformed & empty Temp file
for a file to finish the installation.

Rich
 
B

BillW50

In
Rich said:
I think I set my Temp file to a RamDrive when I was playing around
with RamDisk about 10 years ago. I seem to remember having a problem
when installing a program, or something like that, which required a
reboot & failed when the program searched the now newly reformed &
empty Temp file for a file to finish the installation.

Rich
Oh yes! You are absolutely correct. I do recall this same problem. And
later I just keep the IE cache in the RamDisk and that seems just fine.
 
B

BillW50

In
Sunny said:
Makes sense, though wear-levelling should be your friend.


Not so sure about that ... you have a swapfile for windows to use when
it's short of memory, then you ensure that windows has less memory
available by using some of it for a ramdisk to store the pagefile on?

I can see if you're in some sort of boundary case (e.g approaching the
3.whatever GB limit on a 32bit O/S) it might help, but not as much as
upgrading to a 64bit O/S would.
I only have done it with W2K, since it complains if you turn off the
swapfile. But it doesn't complain if it sits in a RamDisk. And even
Microsoft recommends turning off the swapfile on SSD systems.

http://msdn.microsoft.com/en-US/library/ms933155(v=WinEmbedded.5).aspx
 

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

Top