Re: how much swap size did you take?




virtual memory is used to contain executing processes. using
paged/swapped virtual memory it is possible to have more executing
processes than can fit into real storage. the virtual memory hardware
is used to indicate what pieces are actually in real memory (and where
they are located).

SWAP/paging space is used to contained the virtual memory that isn't
being currently used and has been moved out of real storage to make
room available for other pieces of virtual memory (either for the same
process or other processes).

the amount of SWAP/page space needed on disk is dependent on how much
total virtual memory is required by your active running processes.

this is slightly affected by whether the page replacement algorithm is
following a "DUP" or "NO-DUP" strategy (duplicate or no-duplicate
strategy).

as an undergraduate in the late 60s I did a lot of paging algorithm
stuff. I created lazy allocate ... i.e. on initial use by a process, a
virtual page was allocated in real memory ... but it wasn't required
to allocate a corresponding page on disk (at that time). It was only
when a virtual page was selected for replacement the first time ...
that a page on disk was initially alloccated.

if the total requirement by all processes for virtual memory was
containable by available real storage ... then pages would never be
selected for replacement ... and there was no requirement for
swap/page space on disk.

however, at that time, i used a "duplicate" stragegy. this was when a
virtual page was on disk ... and some process required it. a page was
allocated in real memory (potentially first removing some other
virtual page to disk), the requested virtual page read in and started
being used. however, the copy on disk was left allocated. In this
strategy, there were two allocated copies of the page ... one in real
storage and one on disk. In a scenario where there was demand for real
storage, much larger than available ... eventually all virtual pages
will have been replaced at one time or another. In this scenario,
eventually all virtual pages will have an allocated copy on disk (even
those also having a copy in real memory ... therefor the "duplicate"
reference). This "duplicate" allocation scenario requires that amount
of secondary SWAP/page allocation on disk is equal to the mazimum
amount of virtual memory that may concurrently required by all
processes that you might have running at the same time (which is
dependent on the workload that you happen to be running on the
machine).

later in the 70s, as real memory started becoming much larger ... i
started seeing some configurations where the amount of real storage
(and therefor the number of potential "duplicates") were approaching a
significant percentage of possible available SWAP/page disk
space. This was especially becoming true of those configurations with
fix-head disks and/or electronic disks being used for SWAP/page.

for these configurations i added a "no-duplicate" implementation and
some code that could dynamically switch between "duplicate" strategy
and "no-duplicate" strategy. In the "no-duplicate" strategy, whenever
a virtual page was brought in from disk, the corresponding disk space
was de-allocated (therefor there wasn't a duplicate page both in real
memory and on disk).

For a configuration with heavy SWAP/page use and using a "duplicate"
strategy ... the amount of SWAP/page space tends to be equal to the
maximum virtual memory required by all concurrently running processes.
In the "no-duplicate" strategy the amount of SWAP/page plus real
memory needs to be equal to the maximum virtual memory required by all
concurrently running processes, i.e. in a no-duplicate strategy, the
amount of SWAP/page space can be reduced by the amount of real
storage). The "no-duplicate" calculation real-storage reduciton is
modulo the amount of real-storage required for fixed kernel
requirements and file caching (which may be around 1/3rd of real
storage for some configurations).

misc. past postings mentioning dup & no-dup strategies
http://www.garlic.com/~lynn/93.html#12 managing large amounts of vm
http://www.garlic.com/~lynn/93.html#13 managing large amounts of vm
http://www.garlic.com/~lynn/94.html#9 talk to your I/O cache
http://www.garlic.com/~lynn/2000d.html#13 4341 was "Is a VAX a mainframe?"
http://www.garlic.com/~lynn/2001i.html#42 Question re: Size of Swap File
http://www.garlic.com/~lynn/2001l.html#55 mainframe question
http://www.garlic.com/~lynn/2001n.html#78 Swap partition no bigger than 128MB?????
http://www.garlic.com/~lynn/2002b.html#10 hollow files in unix filesystems?
http://www.garlic.com/~lynn/2002b.html#16 hollow files in unix filesystems?
http://www.garlic.com/~lynn/2002b.html#19 hollow files in unix filesystems?
http://www.garlic.com/~lynn/2002b.html#20 index searching
http://www.garlic.com/~lynn/2002e.html#11 What are some impressive page rates?
http://www.garlic.com/~lynn/2002f.html#20 Blade architectures
http://www.garlic.com/~lynn/2002f.html#26 Blade architectures
http://www.garlic.com/~lynn/2003f.html#5 Alpha performance, why?
http://www.garlic.com/~lynn/2003o.html#62 1teraflops cell processor possible?
http://www.garlic.com/~lynn/2004g.html#17 Infiniband - practicalities for small clusters
http://www.garlic.com/~lynn/2004g.html#18 Infiniband - practicalities for small clusters
http://www.garlic.com/~lynn/2004g.html#20 Infiniband - practicalities for small clusters
http://www.garlic.com/~lynn/2004h.html#19 fast check for binary zeroes in memory
http://www.garlic.com/~lynn/2004i.html#1 Hard disk architecture: are outer cylinders still faster than inner cylinders?
http://www.garlic.com/~lynn/2005c.html#27 [Lit.] Buffer overruns
http://www.garlic.com/~lynn/2005m.html#28 IBM's mini computers--lack thereof
http://www.garlic.com/~lynn/2006c.html#8 IBM 610 workstation computer
http://www.garlic.com/~lynn/2006e.html#45 using 3390 mod-9s

--
Anne & Lynn Wheeler | http://www.garlic.com/~lynn/
.



Relevant Pages

  • Re: Code density and performance?
    ... programs for better virtual memory characteristics. ... 370 was initially announced with only real storage. ... packing in small real storage configurations. ... size was more than offset by the overhead of the smaller disk transfer ...
    (comp.arch)
  • Re: how much swap size did you take?
    ... virtual memory is used to contain executing processes. ... I created lazy allocate ... ... to allocate a corresponding page on disk. ... This "duplicate" allocation scenario requires that amount ...
    (alt.os.linux.redhat)
  • Re: Virtual memory
    ... A common cause of low virtual memory message is that you have insufficient ... How large is your hard disk and how much free ... The Windows XP files alone can take around 3 gb. ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Recd pop up notice re virtual memory
    ... At present the free disk space of 10 gb exceeds 50%, ... Performance Settings, Advanced, Virtual Memory, Change and place the ... "system managed size" will that let Windows allot the correct memory ... How large is your hard disk and how much free disk space. ...
    (microsoft.public.windowsxp.basics)
  • Re: Is Greenspun enough?
    ... > George Neuner wrote: ... >> Seriously, you need to read up on MMUs, virtual memory and demand ... > that they cache everything from disk, ... The caching sometimes happens at first access, and not at mmap time. ...
    (comp.lang.lisp)