Thread: Page file
View Single Post
  #24 (permalink)  
Old 01-19-2007, 05:16 PM
GT
Guest
 
Posts: n/a
Default Re: Page file

"Rod Speed" <rod.speed.aaa@gmail.com> wrote in message
news:51cbuvF1j6r92U1@mid.individual.net...
> GT <ContactGT_remove_@hotmail.com> wrote
>> Rod Speed <rod.speed.aaa@gmail.com> wrote
>>> kony <spam@spam.com> wrote
>>>> Alex Mizrahi <udodenko@users.sourceforge.net> wrote

>
>>>>>> No, pages allocated but never used will not matter, a small
>>>>>> amount of paging does NOT speedup anything. The system
>>>>>> either has enough (real) memory that it doesn't have to page
>>>>>> out (which is ALWAYS faster "IF" the use allows, if it
>>>>>> doesn't require too much memory),

>
>>>>> it might be true if i run a single application cosuming gigabytes of
>>>>> RAM,
>>>>> but usage patterns on modern desktop computers are not like that.

>
>>>> Wrong. Usage patterns do not change it and multiple apps
>>>> merely have additive memory load which is still weighed
>>>> against what the physical memory can support, or can't.

>
>>>> If there is enough physical memory, enabling a pagefile
>>>> will ALWAYS, no matter what other variable, be slower.

>
>>> Wrong with an OS that has enough of a clue to not use it
>>> unless its necessary because there isnt enough physical memory.

>
>> True, but windows does not fall in the category you describe - it
>> automatically loads itself into RAM, then swaps out parts to the swap
>> file without question.

>
> It isnt that black and white. Most obviously when there is no swap file.
>
>>> And even with one that isnt smart enough to always do that,
>>> you havent established that what minimal use of the pagefile
>>> it does do when there is enough physical memory does slow
>>> things down any anyway, most obviously when what minimal
>>> use it does make of the page file is in the background etc.

>
>> In the control panel you can set the minimum and maximum size for the
>> swapfile. These settings do indicate to windows the smallest amount
>> to use if the RAM is not full, it simply says the minimum size that
>> the file will be. This avoids the swapfile becoming fragmented across
>> the disk. Before setting the virtual memory size, I would recommend
>> turning off virtual memory completely, rebooting, defragmenting the
>> hard disk, then setting the minimum and maximum values to the same
>> amount, so that the swapfile is configured in one large contiguous
>> block on the disk and will never grow and shrink and therefore cannot
>> become defragmented. Of course, this is my advice to someone with
>> less RAM than the applications they use can ever need. If you have
>> enough RAM - turn it off and things will be faster, quieter and more
>> responsive.

>
> There's real downsides with no swap file with Win.


Elaborate please - We have already covered the point of running out of RAM
with swapfile turned off, so what downsides are you aware of with no swap
file with Win?

>>>> For the (nonspecific and thus unprovable) "usage patterns
>>>> on modern desktop", it could easily be that there is not
>>>> enough physical memory - hence why a pagefile is enabled
>>>> by default. Only the user can determine that it isn't needed.

>
>>> Wrong, the OS obviously can.

>
>> Wrong, some OS's can, but windows doesn't.

>
> I said CAN, not DOES.


I'm sure some OSs can, but MS Windows CAN'T and its the Windows swapfile we
are talking about so why did you bother to comment on other OSs?

>>>>> i have lots of applications running (74 processes for 2 users),
>>>>> and i don't need all the processes all the time, certainly. i'm
>>>>> even running two OSes simultaneously -- Linux in vmware,
>>>>> but i'm working with that Linux from time to time.
>>>>> so, i think they'll better be swapped out.

>
>>>> IF you don't have enough physical memory to accomdate
>>>> all the rest without swapping, yes. That's not same as
>>>> having enough and paging it out for no good reason.

>
>>> Pity about when the pagefile is just used to provide
>>> faster access to the read only files on the hard drive.

>
>> Who told you that gem?!?

>
> You just restated that yourself in different words at tha top.


I have never stated that the swap file is used to provide faster access to
read only files - this is some tripe that only you have mentioned!

>
> Concentrate on the use of the word WHEN.


If I concentrate on your word WHEN, does your argument make more sense. Hold
on while I try.... Nope you're still wrong.

>>>>> as i've said, if some active
>>>>> process will need more RAM, or if some file operations will need be
>>>>> cached, Windows will swap out that processes anyway -- but it will
>>>>> swap out it's DLL and EXE pages if it cannot swap allocated memory
>>>>> to pagefile.
>>>>> RAM is just a cache for data -- some data is backed by files
>>>>> (executable or filemappings), some is backed by pagefiles, and some
>>>>> will be not backed by anything. OS might optimize better when it
>>>>> has flexibility to swap out some allocated memory that is not used
>>>>> to pagefile. certainly, OS might be wrong in it's optimizations, so
>>>>> it's questionable..
>>>>> if you disable pagefile, you give priority to data that is
>>>>> explicitly allocated by applications that is not backed by
>>>>> anything -- so it's not swapped even if it's not used because
>>>>> there's no place for it. at same time some data that is
>>>>> more-or-less actively used -- for example, file cache that caches
>>>>> filesystem structure MFT -- can be swapped out.

>
>>>> It is true that some data is needed later, or more
>>>> frequently, and some isn't. That does not change
>>>> the fact that swapping out data is going to be slower
>>>> if there was no other use for remaining physical memory.

>
>>> Not if that is done in the background and its never used from the file.

>
>> But loading from virtual memory IS using something from a file - its just
>> not in the original place on the hard disk!

>
> The word IF is there for a reason.


There may be the occasional chunk of data that is swapped out to virtual
memory, then never loaded, but there is significantly more data that is
swapped out to Virtual memory and IS loaded again. Whilst swapping out data
in the background is fine and won't impact performance, the performance hit
is incurred when the majority of data is swapped out while you are doing
something or has to be swapped back in when you need something, or need the
space in the swapfile.

>
>>>> You are arbitrarily presuming there would be, and indeed
>>>> sometimes there is, but that is not the same as a random
>>>> idea about it being faster to page out without the specific
>>>> situation of having insufficient physical memory to hold it all.

>
>>> You are arbitrarily presuming that an OS which does minimally
>>> use a page file when there is enough physical ram, that that
>>> minimal use of the page file has any effect on the speed of ops.

>
>> No, we are stating a fact - swapping files between physical RAM and the
>> slower hard disk (virtual memory) has a performance impact on the system.

>
> It isnt a fact at all IF that only happens in the background with the
> performance impact.


And as we have already discussed, swapping back in doesn't happen in the
background and swapping out doesn't always happen in the background, so like
I said there is a performance impact on the system.

>> Also, like I said above - the minimum setting for the swapfile is not an
>> indication of how much windows will use as a
>> minimum, just the smallest size the swapfile is allowed to be.

>
> Duh.
>
>>> You dont know that.

>
>> Yes we do.

>
> No you dont.
>
>>>>>>> i have 2 GB of RAM and have some small page files.
>>>>>>> i believe it's more optimal, but i can't be sure..

>
>>>>>> If the total amount of allocated memory is beyond 2GB, yes
>>>>>> it is more optimal. If the total amount is below 2GB, it
>>>>>> may depend on how much of a benefit you would see from
>>>>>> having a larger filecache (IF you adjust Windows memory
>>>>>> management to have one, this is not a default installation
>>>>>> condition), it is quite possible the larger filecache
>>>>>> reduces rereads from HDD, more than the I/O to HDD from
>>>>>> slight pagefile use. In the end, the goal is still the
>>>>>> same- based on the specific uses of the system, to minimize
>>>>>> access to the HDD.

>
>>>>>>> it's very unlinkely for windows to crash. memory allocation just
>>>>>>> fails, and actually application can handle this gracefully. btw
>>>>>>> there's one more reason to keep page file size at minimum -- some
>>>>>>> applications erroneosly allocate tons of RAM, and with large
>>>>>>> pagefile swapping make system non-responsible. with less or no
>>>>>>> pagefile, those application will simply honestly report failure..

>
>>>>>> If you're going to have a pagefile active, it should be large
>>>>>> enough to handle the entire memory allocation from applications.

>
>>> Wrong.

>
>> Perhaps you could stretch to more than 1 word in your reasoning here

>
> I did.


Well you only posted the word 'Wrong' in that discussion - perhaps you wrote
the other words of that sentence in white text?
Please focus on the word HERE

>
>> - the standard is for virtual memory to be 100%-150% the size of the RAM

>
> That is just plain silly, most obviously when you go from say 1G to 2G of
> physical ram, with the same machine use, why would you need to double
> the swap file size in that situation ? The use of the swap file will
> DROP.


Almost - the use of the swapfile will remain exactly the same or even
increase because Windows uses it whether it needs to or not, hence our
recommendation that it is turned off on a PC with sufficient RAM. However,
if you insist on having a swapfile, then I repeat, "the STANDARD is for
virtual memory to be 100%-150% the size of the RAM"

>>>>> why?

>
>>>> Because that's the whole point of a pagefile,

>
>>> Nope

>
>> Yup

>
> Nope.
>
>>>> to virtually provide memory that's not there,

>
>>> It isnt the ENTIRE MEMORY ALLOCATION FROM THE APPS
>>> that matters, its the excess over the physical memory that matters.

>
>>>> not to cause the app to not have enough even WITH it.
>>>> Allocation that isn't used is not a bad thing,

>
>>> It can be speed wise if that page file space has to be allocated and is
>>> never used.

>
>>> In spades when you have chosen to run without a page file.

>
>>>> it was that it used the HDD at all that
>>>> causes the significant performance penalty,

>
>>> ONLY if that allocated memory is ever actually used.

>
>> You proove our point

>
> Nope.


Yes it does - you agreed that there is only a performance hit if the virtual
memory is used. We have already told you that windows uses a pagefile
whether it needs to or not, therefore will require to swap pages back into
RAM when required, therefore there is a performance hit. So you DID prove
our point.

>> - it is used all the time by Windows, whether it needs it or not!

>
> Pity that doesnt necessarily produce a performance impact when
> you have large amounts of physical ram, enough for whatever is run.


Let me summarise:
It is a fact that reading a page from virtual memory will be slower than
reading a page from physical RAM.
It is a fact that Windows will use a swapfile if one is present, regardless
of the amount of physical RAM in the system.
It is a fact that swapping out to virtual memory while the user is working
will have an impact on performance
It is a fact that swapping out to virtual memory in the background will NOT
affect the performance from the user's point of view
It is a fact that if any page required by the OS or an application is in
virtual memory, then the performance of that particular operation will be
slowed than if the page had been in physical RAM.
With no swap file, everything loaded will always be in physical RAM and
accessed at maximum speed.
With a swap file, not everything loaded will always be in physical RAM so
there will be an innevitable performance reduction, which will be measurable
when pages are swapped back into physical RAM and measurable when pages are
swapped into virtual memory concurrently with other user activity.

So with the swapfile turned on, windows will use it and the performance of
the PC will be slightly reduced. With the swapfile turned off, windows
cannot use it, so this particular bottleneck in performance will be
elliminated, but we introduce the possibility of windows running out of
memory, which will cause a runtime error in the application in question and
may take the OS down with it.



Reply With Quote