View Single Post
  #24   Report Post  
Posted to uk.d-i-y
Johnny B Good Johnny B Good is offline
external usenet poster
 
Posts: 1,491
Default O/T: Ubuntu questions.

On Thu, 26 Nov 2015 10:51:19 +0000, Tim Watts wrote:

On 26/11/15 08:19, News wrote:
In message , Tim Watts
writes

Strictly, "paging" is the above and "swapping" is when the whole idle
process is written out to disk. But in practise the concept and
effects are much the same.


Paging is what Windows shows as Page File Usage, or PF Usage?


I guess - I don't do windows But the OS principles are the same and
by its name, I suspect its the same.

I do look at the Performance tab of Task Manager, but don't pretend to
understand exactly what I'm looking at. Currently, my CPU usage is
hovering around 10% which is probably OK,


Not probably - it's having a stroll, rather than a sprint

but PF Usage is 2.42GB which is probably not so good.


You need a windows person. Sometimes, it's better to page out large
amounts of dead memory that is never used (unused lumps of data or code
in a program, or at least "unused" in the context of what you are doing
right now) and use the space of disk buffers (cache).

There's also a method of paging that does not use the pagefile - at
least on linux. If you load a program and all its linked code libraries,
the whole lot gets mapped into the process's virtual address space.

However, it tends to not get read in until needed - this happens by the
program and the libraries being mapped as mini pagefiles into the
address maps, but not actually physically read in.

Program goes to the "print" routines (say), trips a page fault - that
causes the same paging code in the kernel to look for the page file
blocks (that this time happen to be the program or library file) and
read them in, resuming the program when done.

In the same way, not-recently-used blocks of the program can simply be
dropped from RAM (no need to write out - code is read-only, we already
have the original in the file) if the system thinks it needs RAM for
something else.

I have no idea if Windows employs that strategy - it's always been my
observation that linux handles memory better than windows, but that's a)
because I hate Windows, b) may be less true with the modern versions.


My impression, as a long time user of win2k and repairer of subsequent
****tier versions, is that they both use, more or less, the same paging
algorithms. The major difference being that *all* versions of NT based
windows use a page *file* rather than the higher performance swap
*partition*.

What's worse are the invented pagefile options available of which the
worst one (adjust pagefile size automatically - on the fly, both upwards
and downwards), is the default setting on new installs - including every
major OEM setup I've ever seen.

The other options are "System Managed" (whatever the **** that means)
and setting a minimum and a maximum size limit (there may be another one
but I'm just remembering this off the top of my head). On an HDD
installation, this default is really bad news since the constant resizing
activity magnifies the effect of file fragmentation as well as adding
extra overhead to the paging algorithm.

If you don't want your windows PC to become old and arthritic before its
time, you need to figure out what size pagefile you want and set the min
and max values to that size as the very first configuration change after
doing a clean install. This then gives you a (possibly completely - but
no guarantees on this) unfragmented fixed size pagefile which won't
aggravate the inevitable file fragmentation activity from ordinary
everyday use, further aggravated by the endless OS file churn due to a
never ending stream of updates and patches.

The use of SSDs has rather sidelined this deliberate misuse of the
paging mechanism to effect premature system performance loss in the name
of boosting the sales of new PC kit (it's the "Wintel Effect"). The
effect of file fragmentation on system performance is all but eliminated
in the case of an SSD installation so this deliberate 'accelerated aging'
policy no longer works for "Wintel" (it's still a good idea to set a
fixed size pagefile, if only to pep up the paging algorithm a little).

I'm rather disappointed to see that Ubuntu and its derivatives resorting
to the madness of a single huge partition for the /boot and /home folders
and using the creation of a swap file instead of a dedicated swap
partition space. Luckily, you can over-ride the default automated
partitioning scheme used by the installer but it needs some familiarity
and an understanding of partitioning to get this reasonably right.

There is usually a "Guided Partitioning" option in modern day distro's
installers but I can't recall whether it offers to create a dedicated
swap partition or not since I use manual control to get what I want (mind
you, for a lot more reasons than just to make sure a dedicated swap
partition is created).


The fun happens if the kernel needs a page of RAM for its own use,
hasn't got any spare and needs to run the pager to free some, except the
pager needs some extra RAM to do its work.

Real problem - solved in part with the concept of "kernel non paged
pool" (locked pages of RAM that cannot be paged out).


I've edited win2k's registry to stop it paging kernel ram space along
with quite few other tuning tricks in the dim and distant past. If I had
to do a scratch install of win2k on real hardware, there's quite a bunch
of things I'd have to research yet again. :-(

--
Johnny B Good