17. Memory
Solaris System V UNIX uses multiple types of memory. Between the CPU and RAM is the MMU
(Memory Maintenance Unit) which keeps track of stuff in memory (RAM). The ZFOD (Zero Fill
On Demand) doesnt use memory, it just tells that zero will be in place, this
is used to save memory space. There is also PROM memory (programmable read only memory)
and other types of memory. Some commands that are for memory are:
- cow copy on write (when ram shares it will only read unless you need it,
then it will copy)
- swap page out will move stuff from memory if its not
used here is what happens in ram (random access memory)
- If there is lots of free RAM, then there will be a deadwood swap.
- If there is a moderate amount of free RAM, then you will notice a shortage of RAM.
- The computer will do the following:
Page out unused block which means that the system marks every page as unused (the
first one), if it is used then the mark goes away, if it is unused by the time the system
comes back, then it will be paged out after a certain amount of time. The page goes to
swap. There is something called the handspread, which tells the computer how long to wait
to swap out a mod. Think of a clock, where the hour hand represents the first marking of
every page. When the minute hand comes around and if the file has not been used, then the
file is swapped. The time in between the minute and hour hand is the handspread.
- Desfree (desperate free) - If there is little free space left in RAM, then the system
will start swapping active processes, and doing deadwood swaps
- When there is ½ of desfree, then the system will allow no new processes, no new memory,
and will do busy swap (which means 10 biggest processes get swapped out, no matter what),
or the computer will recover or crash. For a swap partition you have to repartition and
lose all data (best way to go).
For a swap partition the slice must be in place, not be mounted, not a cache, not a
database, and not zero size. (format or prtvtoc will give you information
about your partitions) swap a /dev/dsk/[disk address] to make a swap
partition, then do a reboot. cat>> /etc/vfstab shows vfstab for mounting
info, would look like /dev/dsk/c0t0d0s0 - - swap no . swap
s shows swap space, swap l shows swap partition.
RAM + Swap space = virtual memory
kernel must run processes
Go to Chapter 16
Go to Index
Go
to Chapter 18