Week 03 Journal Chapter 6 from A+ Textbook: Memory and Class handouts - Hsanokklis/2022-2023-Tech-journal GitHub Wiki

Source #1 - Memory Management Handout

Summary: Memory is an important part of a computer system and needs to be properly maintained and managed to maximize the efficiency of your device.

Basic Memory Management:

Partitioning:

Paging:

  • Physical memory is divided into equal size page frames
  • Program is divided into equal sized pages
  • The size of a page frame and a page is the same
  • Any page can fit in a page frame, so a page can be assigned to any available page frame.
  • Controls how memory resources are shared.

Memory Management Requirements: Relocation:

  • Programs not loaded into a fixed point in memory but may reside in various areas

Protection:

  • Processes should be protected against unwanted interference by other processes
  • Processes that are generated must not have any memory that was not assigned to it

Sharing:

  • Protection mechanisms cannot block other processes from accessing the same area of memory.

Contiguous Organization: ???

  • Programs are organized into sequential modules

Non-contiguous Organization:

  • Memory is put into varying locations based on need and available space

Segmentation:

  • Memory management technique in which each job is divided into several segments of different sizes.

Source #2 - Process Management Handout

Summary: Processes are system activities run by the CPU that use resources such as time, memory, files, and I/O devices to complete tasks.

Process:

  • A program in execution(the unit of work in a system) The resources that are needed to execute a process are given to it when it is created.

Operating System Duties(in the context of processes):

  • Creation and deletion of user and system processes
  • Suspension of resumption processes
  • Provision of mechanism for process synchronization
  • Provision of mechanisms for deadlock handling( process or set of processes is blocked because its waiting for a resource)

The Concept of Process:

  • An instance of a program in execution (a processes is formally defined by this definition)
  • An asynchronous activity
  • Unit of work individually schedulable by an operating system

Difference between Process and Program:

  • A program is a group of instructions, and a process is an activity.

Process Management:

Operating System Duties(in the context of process management functions):

  • Process creation
  • Termination of the process
  • Controlling progress of a process
  • Process scheduling
  • Dispatching(process resources)
  • Interrupt handling
  • Switching between processes
  • Process synchronization
  • Interprocess communication support
  • Management of process control blocks

Process States: The lifespan of a process can be in one of five states:

Executing Process is currently running and has control of CPU Waiting Process is currently able to run, but must wait until CPU is available Blocked Process is waiting on an I/O, for input to arrive or output to be sent **Suspended ** Process is able to run but for some reason the OS has not put the process in the ready queue Ready Process is in memory, and will execute given CPU time

Implementation of Processes: In the process model the OS maintains a table called the process table(process control block, switch frame), wherein each entry identifies a process.

Information stored includes:

  • Process state
  • Process number(each process has a process ID)
  • Program counter(address of the next instruction for the process)
  • CPu registers
  • Memory management info
  • I/O status Info
  • List of open files
  • Processor scheduling info

Threads: Independently scheduled parts of a single program, which allow us to split up a program into separate pieces and have the pieces run independently until they need to communicate.

Multithreaded: A task that is composed of several independent sub-processes that work on common data.

Why use threads? Threads make it so that the scheduler knows exactly what each program is going to do in advance so it doesn't have to organize everything when the program is actually being executed. A process that uses threads does not get more CPU time than a normal process.

Process Scheduling: All computer resources are scheduled before they are used, making scheduling an important part of an OS. It is essentially a set of policies and mechanisms that control the order in which the work to be done is completed. The primary goal of scheduling is to improve system performance.

Throughput: Amount of work accomplished in a given time interval

List of Process Scheduling Goals:

  • Maximize throughput
  • Serve largest possible number of processes per unit time
  • Be predictable
  • Minimize overload
  • Balance resource use
  • Achieve balance between response and utilization
  • Enforce policies
  • Avoid indefinite postponement
  • Give preference to processes holding key resources
  • Degrade gracefully under heavy loads
  • Should not collapse under heavy system load

Source #3 - Chapter 6: Memory

_Memory Overview: _ _Software that lets a computer operate is contained within its memory. There are 2 types of memory, Random Access Memory (RAM) and Read-only memory (ROM). _

The differences between RAM and ROM are shown below:

image

RAM: Divided into 2 types: Dynamic RAM(DRAM) and Static RAM(SRAM)

DRAM:

  • Less expensive but slower than SRAM
  • 1s and 0s inside chip must be refreshed
  • Over time information leaks out because its rewritten in the refresh process
  • Refreshing is why DRAM is slower than SRAM
  • Most memory on a motherboard is DRAM

SRAM:

  • Also known as cache memory
  • Found inside processor, just outside processor, and sometimes on the motherboard
  • Holds most frequently used data so CPU does not need to fetch data from DRAM

Hierarchy of Information for the Processor:

  • First looks to cache(SRAM) for data or instruction
  • Second looks to DRAM for data or instruction
  • Third looks to hard drive for data or instruction

Planning a Memory Installation:

Key steps include:

  • Look at the system to see what of memory is supported
  • Determine what features are supported
  • Determine how much memory is needed
  • Determine how many of each memory module is needed
  • Research prices and purchase memory modules

Planning the Memory Installation: Memory Module Types

image

Above is a list of Memory Module types

Chipset

  • one to five electronic chips on the motherboard
  • If the motherboard supports faster memory chips is determined by the chipset that performs most functions in conjunction with the processor.
  • Controls local bus, memory, DMA, and cache memory

Memory Modules: They all are the same physical size, but since they are different they won't fit into the others' slots. The chips have metal casing(heat spreader) made from aluminum or copper to dissipate heat away from the memory. DDR: Uses 184 pins DDR2: Uses 240 pins DDR3: Uses 240 pins DDR4: Uses 288 pins

Planning the Memory Installation: Memory Features: You have to determine which features are supported by the motherboard.

image

image

Above are some memory features

*Some motherboards might not support both non-parity and Error correcting code(ECC), or might require a certain feature such as SPD.

*memory modules might use more than one of the categories listed in the above tables.

Windows Disk Caching:

Virtual memory:

  • A method of using hard drive space as if it were RAM
  • Allows OS to run larger applications
  • Hard drive space is dynamic

Swap File(page file or paging file):

  • A block of hard drive space that applications use like RAM

The process on Windows:

  • 32 bit windows uses 32 bit paged virtual memory
  • Each process gets 4gb of address space, divided into two 2GB sections
  • One 2GB section is shared with the rest of the system
  • Other 2GB section is reserved for application
  • All memory space is divide into 4KB blocks of memory called pages
  • OS allocates as much available RAM to an application
  • The OS swaps or pages the application to and from the temporary swap file as needed

image

Windows virtual memory usage

Monitoring Memory Usage in Windows: Performance utility in Task Manager monitors memory usage(press ctrl + alt + delete, then go to performance tab)

It should look something like this:

image

image

Here is a description of what we see in the performance tab

image

image

Here is a description of what we see in the memory tab

Flash Memory; Non-volatile, solid-state memory that holds data even when the computer is off. It does not have to be refreshed like DRAM and does not need constant power like SRAM

Uses of Flash memory:

  • PCs:
  • Used as a replacement for the BIOS chip
  • Network devices, smartphones, tablets:
  • Used to store OS and instructions
  • Digital cameras:
  • Store pictures
  • Printers:
  • Store fonts

USB flash drives(thumb drives, memory bars/sticks):

  • Allow storage up to 256GB
  • Flash drive failure can be caused by improper removal, so you must eject the flash drive when you want to remove it.

Guiding Questions:

Based on the number of applications you typically run and the amount of physical RAM on your system, do you think your personal computer should use a larger or smaller page file?

My current PC has 32GB of RAM. I got this much RAM because I thought I would need to run huge applications, but it turns out I can run bigger applications in the computer labs at school. This means that I have way too much RAM for the everyday applications I run on my computer. I do enjoy that my computer runs so fast but I think I could have gone with less RAM and still have been fine. I plan on using Adobe products such as photoshop as well as running virtual machines from my computer so I know those will need more RAM to run efficiently, but otherwise applications like google browser dont need that much RAM to run. 

Talk about your experience with using flash memory (for example, USB flash drives) in the past. Do you think making hard drives out of flash memory rather than spinning disks would be a good decision? (We'll be discussing drives like this in more detail in a couple of weeks!)

I have used many USB flash drives in the past to transfer information. I do digital photography and when I need to get my pictures from my camera to my computer I can transfer them over using a flash drive. I have used flash drives to store music, images, videos and other files in general. I definitely think making hard drives out of flash memory rather than spinning disk would be a good decision. Firstly because they don't need any moving parts and it can still contain data just as well. Plus it seems to be smaller and cheaper to use flash.

⚠️ **GitHub.com Fallback** ⚠️