COSC360 Exam 2

0.0(0)
Studied by 2 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/59

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:18 PM on 4/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

60 Terms

1
New cards

Multiprogramming

multiple processes are ready in memory to run at a given time and the OS can switch between them

2
New cards

Timesharing

OS rapidly switches CPU among multiple processes giving the illusion of interactive use of the machine

3
New cards

Interactivity

allows users to receive timely responses from the system while their programs are running instead of waiting long periods

4
New cards

Address space

running program’s view of memory in the system; set of addresses you have access to

5
New cards

Virtual addresses

address used by a program within its address space; not real physical address, but translated by OS and hardware into physical address

6
New cards

Process protection

OS ensures a process cannot access/modify memory outside its own address space

7
New cards

Stack

memory is automatically allocated/deallocated by the compiler; function calls, local variables, and return values; aka automatic memory

8
New cards

Heap

allocations/deallocations are explicitly handled by the programmer

9
New cards

malloc()

allocated a specified number of bytes on the heap and returns a pointer to that memory

10
New cards

free()

deallocated previously allocated heap memory

11
New cards

Garbage collection

system detects unused memory and frees it

12
New cards

Common memory errors

Forgetting to allocate memory → seg fault

Not allocating enough memory → buffer overflow

Forgetting to initialize allocated memory → uninitialized read

Forgetting to free memory → memory leak

Freeing memory before you’re done with it → dangling pointer

Freeing memory repeatedly (double free) → undefined

Calling free() incorrectly → invalid frees

13
New cards

Address translation

hardware transforms each memory access and changes the virtual address to a physical address where the desired information is located

14
New cards

Physical address

actual location in main memory (RAM) where data resides

15
New cards

Virtual address

each memory reference generated by the process; address generated by a program; part of its own private address space

16
New cards

Base

used to transform virtual addresses into physical addresses

17
New cards

Bounds

ensures addresses are within the confines of the address space

18
New cards

Memory management unit (MMU)

part of the processor that helps with address translation, checks if addresses are within bounds, helps enforce memory protection

19
New cards

Free list

a list of the ranges of the physical memory which are currently not in use

20
New cards

Segmentation

Idea of having a base and bounds pair per logical segment of the address space

Allows OS to place each one of the segments in the address space (code, stack, heap) in different parts of physical memory

21
New cards

Segmentation fault

arises from a memory access on a segmented machine to an illegal address

22
New cards

Segment vs offset values

Segment is determined from the top bits of the virtual address, offset is the remaining bits which specify the location within the segment

Segment is which section of memory you’re talking about, offset is how far inside that section you go

Hardware uses segment to select correct base bounds pair and uses the offset to check if it is within bounds and adds it to the base to form the physical address

23
New cards

External fragmentation

problem where physical memory becomes full of little holes of free space

24
New cards

Internal fragmentation

any unasked for/unused space in chunks of memory bigger than that requested handed out by the allocator

25
New cards

Splitting

find free chunk of memory that can satisfy the request and split it into two; first chunk will return to caller and second chunk will remain on the list

26
New cards

Coalescing

When a chunk of memory is freed, merge it with neighboring free chunks into a single larger free chunk to reduce fragmentation

27
New cards

Header block

kept in memory usually just before the handed-out chunk of memory; minimally contains size of the allocated region and may contain additional pointers to speed up deallocation

28
New cards

Best Fit

find chunks of free memory big/bigger than requested size in free list and return the smallest

29
New cards

Worst Fit

find largest chunk and return the requested amount and keep remaining large chunk on free list

30
New cards

First Fit

finds first block that is big enough and return requested amount to user; advantage is speed

31
New cards

Next Fit

keeps and extra pointer to the location within the list where one was looking last

32
New cards

Pages

fixed-size block of a process’s virtual memory

33
New cards

Frames

fixed-size block of physical memory; each page is stored in one page frame

34
New cards

Page table

per-process data structure that stores address translations for each of the virtual pages of the address space letting us know where in physical memory each page resides

35
New cards

Virtual page number

part of virtual address that identifies which virtual page and is used to index the page table

36
New cards

Offset (in segmentation)

How far from the start of the segment the address is (aka where inside the segment)

PA = Base[segment] + Offset

37
New cards

Segment

Continuous chunk of virtual memory; each represents a logical part of the program (ex: code, heap, stack); often determined by top bits of the VA

38
New cards

Offset (in paging)

part of VA that specifies which byte within a page is being accessed

39
New cards

Physical frame number

Physical addresses; identifier of a physical page frame in memory; used in page table to translate virtual page into its physical memory location

40
New cards

Valid bit

indicates whether the particular translation is valid; crucial for supporting a sparse address space

41
New cards

Present bit

indicates whether this page is in physical memory or on a disk (meaning it has been swapped out)

42
New cards

Hard disk drive

place to stash away portions of address spaces that currently aren’t in great demand; sit at the bottom of the memory hierarchy with memory just above

43
New cards

Swap spaces

space on the disk reserved for moving pages back and forth; swaps pages out memory to it and then swaps pages into memory from it

44
New cards

Page hit

occurs when CPU accesses a memory page already present in RAM

45
New cards

Page miss/fault

act of accessing a page that is not in physical memory

46
New cards

Page in

process of reading a page from disk into physical memory

47
New cards

Page out

process of writing a page from physical memory to disk

48
New cards

Page-replacement policy

Process of picking a page to kick out/replace

49
New cards

Eviction

process of removing a page from physical memory to make space for a new page when memory is full

50
New cards

Cache

fast memory holding recently/frequently used pages so they can be accessed quickly

51
New cards

Optimal replacement policy

policy that evicts the page that will be used farthest in the future and produces the fewest possible misses

52
New cards

Policies: FIFO

Evicts the page that has been in memory the longest

53
New cards

Policies: Random

Evicts randomly chosen page

54
New cards

Policies: Least Recently Used (LRU)

replaces least recently used page

55
New cards

Policies: Least Frequently Used

replaces least frequently used page when an eviction must take place

56
New cards

Policies: Most Recently Used (MRU)

Evicts page that was used most recently

57
New cards

Policies: Most Frequently Used

Evicts page with the highest number of accesses

58
New cards

Dirty Bit

aka modified bit; set any time a page is written and thus can be incorporated into the page-replacement algorithm

associated with a page that indicated whether it has been modified in memory

1 → page has been modified so the OS must write it back to the hard disk before replacing to avoid data loss

0 → page has not been modified and can be discarded without updating disk

59
New cards

Demand Paging

OS brings the page into memory when it is accessed “on demand”

60
New cards

Thrashing

condition where system spends most of its time swapping pages in and out (paging) instead of executing programs usually because there isn’t enough physical memory