Very confused about pagefile!

P

Peter Hucker

I looked in the task manager, and noticed that every task was using approximately
equal amounts of memory and pagefile. Also, under the performance tab, a fair
amount of pagefile is being used.

I have 3GB ram.

I have set the pagefile to 20-30MB on each of the two hard disks. Putting zero or
smaller amounts on either drive seems to make it ignore me and create whopping great
GB swaps!

At the moment, task manager claims to be using 469MB of pagefile (in the performance
tab), and under the processes tab, VM sizes are similar to Mem usage sizes, the
largest application using 188MB of ram and 198MB of VM.

Yet that actual pagefile.sys files in the root of the two drives are both 30MB! How
can this be?
 
W

Will Denny

Hi

See if the following article by MVP Alex Nichol helps:

"Virtual Memory in Windows XP"
http://aumha.org/win5/a/xpvm.php

--

Will Denny
MS-MVP Windows - Shell/User


| I looked in the task manager, and noticed that every task was using approximately
| equal amounts of memory and pagefile. Also, under the performance tab, a fair
| amount of pagefile is being used.
|
| I have 3GB ram.
|
| I have set the pagefile to 20-30MB on each of the two hard disks. Putting zero or
| smaller amounts on either drive seems to make it ignore me and create whopping great
| GB swaps!
|
| At the moment, task manager claims to be using 469MB of pagefile (in the performance
| tab), and under the processes tab, VM sizes are similar to Mem usage sizes, the
| largest application using 188MB of ram and 198MB of VM.
|
| Yet that actual pagefile.sys files in the root of the two drives are both 30MB! How
| can this be?
|
| --
| Artifical intellegence is always better than real stupidity.
 
W

Will Denny

You're welcome - glad to help.

--

Will Denny
MS-MVP Windows - Shell/User


|
| > Hi
| >
| > See if the following article by MVP Alex Nichol helps:
| >
| > "Virtual Memory in Windows XP"
| > http://aumha.org/win5/a/xpvm.php
|
| Thanks. That answered all my questions :)
|
| --
| I took an IQ test and the results were negative.
 
J

Jim

Sorry, I have to chime in because this is one of my biggest pet-peeves.

With regard to the following in that document:

<begin>
"Can the Virtual Memory be turned off on a really large machine?

Strictly speaking Virtual Memory is always in operation and cannot be
"turned off." What is meant by such wording is "set the system to use no
page file space at all."

Doing this would waste a lot of the RAM. The reason is that when programs
ask for an allocation of Virtual memory space, they may ask for a great deal
more than they ever actually bring into use - the total may easily run to
hundreds of megabytes. These addresses have to be assigned to somewhere by
the system. If there is a page file available, the system can assign them to
it - if there is not, they have to be assigned to RAM, locking it out from
any actual use."
<end>

With all due respect, and I have no quibble w/ the gist of the rest of the
document, but in this regard, this statement is total nonsense. For the
record, the truth is, *if* (and I emphasize, *if*) you have enough RAM, you
do not need a paging file!

Over and over again, in this and similar forums, the concept of virtual
memory and the paging file (its implementation) are misunderstood.

The virtual memory subsystem (and by extension, the paging file) is just an
artifact of the fact that *historically* RAM has been exceedingly expensive,
especially compared to HD space. So some geek (probably an IBM engineer)
thought, "hey, let's extend physical memory by mapping it to the HD"! If
RAM had always been as cheap and ubiquitous as paperclips, the concept
itself never would have been invented. But this never seems to sink in.
The amount of time and effort spent on where to place the paging file, its
best size, etc., never ceases to amaze me. I've always said, if you're
hitting the paging file at all, you need more RAM. Likewise, if you have
enough RAM, you never hit the paging file anyway. So in the end, the whole
discussion is moot.

The document is factually wrong in this regard, programs don't ask for
"virtual memory", they simply ask for "memory". Memory is an "abstract"
notion to programs, or at least it should be. No program should be written
that makes a distinction between virtual memory and memory (RAM). If
tomorrow, a new solution is invented to support the memory subsystem that
does NOT involve virtual memory, or even RAM, Microsoft should be able to
remove the virtual memory subsystem (and by extension, the paging file),
insert its replacement, with applications none the wiser. Again,
applications need only be concerned about memory, period.

That also means that if the virtual memory subsystem was completely removed
from Windows (nothing says it has to be there, Microsoft has implemented it
for a specific reason, which is, the historical limits of RAM in modern
computing systems), Windows would continue to function *exactly* as before.
Of course, if RAM *is* exceeded in that case, you have all the problems of
any OS which exhausts memory (instability, crash, whatever).

Once you understand this concept, a light should go off. I can, in effect,
make the virtual memory subsystem *unnecessary*, indeed, *obsolete* by
creating the environment that makes that possible. And that is, *if* I have
sufficient RAM to hold everything that must be loaded into memory, then I do
NOT need the virtual memory subsystem at all, and by extension, neither the
paging file!

The document betrays a serious misunderstanding of the virtual memory
subsystem. The idea that one should not *burden* RAM with unnecessary
memory allocations that may never be referenced, misses the point. If I
have enough RAM, who cares!!! What the author is doing is assuming that
*even* if there is enough RAM, there *isn't* enough RAM (hardly makes any
sense). It's contradictory. I don't give a rat's @ss if *everything* is
loaded into RAM, in fact, I hope and pray it *is*! My system will run that
much faster, rather than unnecessarily poking around the paging file, and
leading to unnecessary I/O (potentially). That's why I bought the RAM in
the first place. If everything, and I mean *everything*, can fit into RAM,
then so be it, I never have the overhead of HD I/O to concern myself with.
Frankly, I wish the whole, darn HD could be loaded into memory, and that
memory was stateful. In a not so distant universe, they call this a PDA!

Did you ever wonder why a PDA never has a paging file, or even virtual
memory? Because everything *is* in RAM! Granted, they use less memory
overall, the applications are less demanding, and don't have any practical
alternatives, like a HD. But it illustrates a point, if you have enough
RAM, virtual memory is irrelevant, nonsensical, indeed, pointless. Also,
notice how much more *careful* those programmers must be, you're not likely
to find third-rater's on *those* projects, Microsoft shuffles them off to
Windows XP where such sloppiness is *acceptable*.

The argument I'm making is that with the proliferation of vast amounts of
RAM at reasonable prices, our PC systems can be visualized as something more
akin to a PDA. Unfortunately, we haven't solved the stateful memory
problem, not yet anyway, it's far too expensive for the vast amounts of data
we like to store. But if and when that day comes, the HD itself will be
obsolete. And there goes the paging file folks! All you paging file
*experts* will be looking for new work.

Why these concepts elude so many people escapes me. Multitudes have become
enamored in the intricacies of the paging file, it's taken on an almost
mystical nature. Something to be nurtured, appreciated, and fawned over. I
have 1GB of RAM installed under XP, I've disabled the paging file (which as
far as I know, is the only thing that comes close to disabling the virtual
memory subsystem itself, I realize this isn't technically true, but it's the
best the end-user can do), and I'm happy as a clam to be rid of it.

Now consider this specific post. The author has 3GB of RAM! Let me say
that one more time, the author has 3GB of RAM! Holy crap, you mean to tell
me this isn't enough to warrant disabling the paging file? Are you kidding
me? If you can't eliminate the paging file when the installed RAM likely
*exceeds* that of the maximum allocation of virtual memory, when will you
*ever* be able to eliminate it?!

If everything Peter does never exceeds 1GB, and he has 3GB, what in the
world difference does it make if memory allocations are "wasted". All this
indicates is bad programming practices. Perhaps if virtual memory wasn't so
readily available, all these third-rate programmers might actually have to
be more careful and not mindlessly, frivolously consuming resources like a
drunken sailor. Personally, I despise the fact I have to buy more RAM to
contend with such sloppiness, but I'd rather do that than cope by resorting
to the paging file. The paging file (and virtual memory subsystem) is the
"ball and chain" of Windows. Personally, I prefer to be set free.

This is why we have large amounts of RAM made available to us, at reasonable
prices (certainly compared to years past). When you start reaching 2, 3 or
more GB, it's time to take stock and decide if the paging file is useful any
longer. For many, the argument can be made that indeed, the paging file is
obsolete given the right conditions (e.g., 3GB RAM and no extraordinarily
memory intensive applications, like audio/video editing, is a heck of a good
case). In that scenario, the paging file is about as useful and meaningful
as your appendix.

Peter, turn off the paging file, you don't need it, for Pete's sake (pun
intended), you have 3GB of RAM! As long as the installed RAM always exceeds
the amount ever allocated by Windows, applications, etc., even *wasteful*
allocations, then the virtual memory subsystem and the paging file are
superfluous. Every access of the paging file is slower than any comparable
access to RAM. If it wasn't, why would we bother with RAM, we'd simply use
the HD for everything!

And while you may be tempted to install a minimal "CYA" paging file, the
system will be tempted to use it, and thus expand it, even though sufficient
RAM is available, so I advise against it. Call me skeptical, but I have no
doubt there are poorly coded subsystems within the OS that will attempt to
use the paging file, if present, even though unnecessary. If I had a
magical "switch" or registry option that could disable the virtual memory
subsystem proper, I'd use it.

I know there are applications, like PhotoShop, that scream when they don't
see the paging file, another classic mistake. It's of no concern to
PhotoShop or similar memory hogs whether there is or is not a paging file.
The authors are *assuming* that you do NOT have sufficient RAM, therefore
*assuming* the existence of virtual memory is necessary and indeed
available, and therefore *assuming* no one should be without a paging file
(their form of CYA). It all harkens back to this mindset that treats the
paging file as a necessity, an integral part of what's required by
applications. It's not, NOT if you have sufficient RAM. That's all
PhotoShop and the rest should be concerned about. These applications should
be asking the OS for the amount of available "memory", not "virtual memory",
nor whether a paging file exists. Only the OS needs to know the true origins
of memory, NOT applications. The OS should, in response, be reporting to
the application the amount of memory available as RAM + (potential) virtual
memory. If no paging file exists, then naturally the result is merely RAM.
If that report proves insufficient to the application, *then* and only then
should it complain/warn of insufficient memory.

If you are confused, don't agree, etc., all you need to ask yourself is one
little ol' question, "if we had unlimited amounts of RAM, would we need a
virtual memory subsystem at all"? The answer is NO. Therefore, one must
draw the obvious conclusion, if I have something less, say *sufficient* RAM,
do I need a virtual memory subsystem? The answer is probably NO. And since
the virtual memory subsystem is the abstraction, the implementation
(pagefile.sys) is itself unnecessary. Finally, if I have *insufficient*
RAM, do I need., well, you get the point.

Now, is it possible that Microsoft blundered and established virtual memory
dependencies? One would hope not, they do seem smarter than that. But if
they have, I'm sure we'll be hearing about them shortly, and if so, it
illustrates a serious weakness in Windows, something that's inexcusable
within the NT core. And if that's the only reason I or anyone else is tied
to this "ball and chain" any longer, then shame on Microsoft.

Someday folks, all our PCs will be the functional equivalent of a PDA, and
all this crap (virtually memory, paging file, HDs, stateless memory) will be
considered the digital "stone age". I just think it's time we entered the
bronze age, at least.

My motto is, "the best paging file is no paging file". If you have
*sufficient* RAM, you don't need it, case closed.

LET MY PEOPLE GO! FREE THEM FROM THEIR VM CHAINS!

Jim


Hi

See if the following article by MVP Alex Nichol helps:

"Virtual Memory in Windows XP"
http://aumha.org/win5/a/xpvm.php

--

Will Denny
MS-MVP Windows - Shell/User


| I looked in the task manager, and noticed that every task was using
approximately
| equal amounts of memory and pagefile. Also, under the performance tab, a
fair
| amount of pagefile is being used.
|
| I have 3GB ram.
|
| I have set the pagefile to 20-30MB on each of the two hard disks. Putting
zero or
| smaller amounts on either drive seems to make it ignore me and create
whopping great
| GB swaps!
|
| At the moment, task manager claims to be using 469MB of pagefile (in the
performance
| tab), and under the processes tab, VM sizes are similar to Mem usage
sizes, the
| largest application using 188MB of ram and 198MB of VM.
|
| Yet that actual pagefile.sys files in the root of the two drives are both
30MB! How
| can this be?
|
| --
| Artifical intellegence is always better than real stupidity.
 
Z

Zoolook

Crikey... do you feel better now you got that off your chest?

By the way.... WELL SAID THAT MAN!
 

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