 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nate Lockwood Guest
|
Posted: Sun Sep 11, 2005 4:54 pm Post subject: Pagefile (swapfile) size |
|
|
Recently I've been having problems with a third party application that
takes lots of memory; XP says it's adjusting page size and everything
slows down or freezes for a while. I suspect that the application asks
for even more memory and XP allocates it etc.
Since I had only 356 MB RAM I upgraded to 1.5 GB and the problem went
away but I started thinking about swapfile size since I remembered that
the size of the swapfile was related to the amount of RAM.
Her is what XP Help says:
"Managing computer memory
When your computer is running low on random access memory (RAM) and more
is needed to complete your current task, Windows uses hard drive space
to simulate system RAM. In Windows, this is known as virtual memory, and
often called the pagefile. This is similar to the UNIX swapfile. The
default size of the virtual memory pagefile (appropriately named
Pagefile.sys) created during installation is 1.5 times the amount of RAM
on your computer."
Now why would I need even more swapfile space with more RAM? I would
think that the more RAM I have the less swapfile space I would need or
that no matter how much RAM I have the required swapfile space would
depend on how many concurrent processes are running and how much memory
they want.
Just curious.
Nate
|
|
| Back to top |
|
 |
Andrue Cope [TeamB] Guest
|
Posted: Mon Sep 12, 2005 7:56 am Post subject: Re: Pagefile (swapfile) size |
|
|
Nate Lockwood wrote:
| Quote: | Now why would I need even more swapfile space with more RAM?
|
I think it's because of the way Windows handles virtual memory which is
a bit different to traditional systems.
In traditional systems the 'swapfile' is where things end up when
there's no RAM available to hold them. Basically they get squeezed out
and end up on disk. In this scenario the swap file can be kept small.
Adding enough RAM can actually make the swapfile redundant.
Windows has a different strategy. In Windows RAM is reserved for things
that are currently needed and less active data is proactively moved out
to disk. In this case the swapfile will always be being used and adding
more RAM implies that more swapfile is required as well.
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Nate Lockwood Guest
|
Posted: Mon Sep 12, 2005 3:01 pm Post subject: Re: Pagefile (swapfile) size |
|
|
Andrue Cope [TeamB] wrote:
| Quote: |
In Windows RAM is reserved for things
that are currently needed and less active data is proactively moved out
to disk. In this case the swapfile will always be being used and adding
more RAM implies that more swapfile is required as well.
|
Thanks, Andrue, that makes sense. Does that mean that data can exist in
both places so that data in RAM can be used if it has not been over
written?
Nate
|
|
| Back to top |
|
 |
Andrue Cope [TeamB] Guest
|
Posted: Mon Sep 12, 2005 3:40 pm Post subject: Re: Pagefile (swapfile) size |
|
|
Nate Lockwood wrote:
| Quote: | Does that mean that data can exist in both places so that data in
RAM can be used if it has not been over written?
|
Yes, according to 'Inside Windows NT'.
A page frame is zeroed before reuse (so as to adhere to the DoD C2
rules) but like most operations it is on-demand or 'lazy
initialisation'. When a frame has been swapped out it remains in a
'Standby' state and can be reactivated.
As I understand it each frame of a process (4kB chunk of its address
space) has a PTE (Page Table Entry). The PTE indicates whether or not
the frame is backed by RAM and if so, where it is. When a frame is
swapped out of RAM the entry is initially changed to 'in transition'.
It doesn't become 'invalid' unless the RAM backing it gets reused.
Changing from 'in transition' back to 'valid' is apparently possible
and a feature of the Windows VM.
FWIW I haven't actually played with any of this myself. It's just an
aspect of OS design that fascinates me so I've done a lot of research.
'Inside Windows NT' is a great source of information and a good read.
It's by Helen Custer who also wrote 'Inside Windows NT File System'. My
own experience of NTFS allows me to say that although she occasionally
fudges the issue it's more a case of avoiding interminable detail
rather than innaccuracy.
ISBN:'Inside Windows NT':1-55615-481-X
ISBN:'Inside Windows NT File System':1-55615-660-X
Generally speaking I prefer the traditional 'swap out when you have to'
strategy. ISTM that it allows a system to evolve into a stable,
RAM-efficient configuration. In effect the VM adapts to the way the
computer is being used and fully utilises RAM.
Win2K is better than Win3 at least. Win3 seemed to like running with
50% of RAM unused which IMO was utter stupidity. Win2K seems more
relaxed about things but I still think there's something wrong in using
the swap file before RAM is exhausted.
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
Nate Lockwood Guest
|
Posted: Mon Sep 12, 2005 4:50 pm Post subject: Re: Pagefile (swapfile) size |
|
|
Andrue Cope [TeamB] wrote:
| Quote: |
A page frame is zeroed before reuse (so as to adhere to the DoD C2
rules) but like most operations it is on-demand or 'lazy
initialisation'. When a frame has been swapped out it remains in a
'Standby' state and can be reactivated.
|
I guess that this would mean that availability of RAM wouldn't have to
wait for transfer to disk in most cases and that would tend keep the
execution speed high.
I watched swap file usage by NIS when doing a Live Update. Norton
insisted on updating my Parental Controls even though I don't use them.
At the start the OS was using just over 256 MB of RAM and as the
installation of the download progressed over 2 GB of swap file were
used. It ramped up as a straight line and progress appeared to slow at
the end. Now, unless the update was really, REALLY, compressed, it
didn't appear to download anything like a couple of hundred MB of data
so I don't know what it was doing - lots of recursive calls perhaps.
It's lots faster with 1.5 GB of RAM compared to my old 1/4 GB, though,
and the computer remains responsive.
Thanks
Nate
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|