Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Other

CS 354 - EXAM 2 STUDY GUIDE

Document preview thumbnail
Preview 2 out of 5 pages

CS 354 - EXAM 2 STUDY GUIDE

Content preview

CS 354 - EXAM 2 STUDY GUIDE
Posix API - Answer -standard for maintaining comp. between different UNIX OS

brk - Answer -"program break" - OS's ptr to top of heap

sbrk - Answer -attempts to change the program's top of heap by incr bytes

Dynamically allocated memory - Answer -allocated during runtime to satisfy uncertain
memory needs (process data files/doc/images/spreadsheets)

Heap - Answer -- a segment of processes virtual addr space used for dynamically
allocated memory
- a collection of various-sized memory blocks that are managed by an allocator

Block - Answer -- contiguous chunk of memory
- contains payload and overhead

Payload - Answer -part of block that is usable by process

Overhead - Answer -part of the block that is used by allocator to manage heap
structure

Allocator - Answer -code that allocates and frees blocks as well as "splits" and
"merges" them

Throughput - Answer -- #of malloc and free ops/sec
- higher is better
- free O(1) independent of number of heap blocks
- malloc O(N) linearly dep. on # heap blocks

Memory utilization - Answer -- % of memory used for payload: mem-requests
- mem requests(bytes)/heap allocated(bytes)
- higher is better

Double word alignment - Answer -1) heap blocks size must be a multiple of 8
2) payload address must be word-aligned (multiple of 8)

External fragmentation - Answer -when there is enough free heap memory, but it is
divided into blocks that are too small to satisfy request

Internal fragmentation - Answer -memory in block is used as overhead instead of
payload

Size - Answer -# of bytes in heap block (payload + overhead)

, Status - Answer -whether block is allocated or free

Explicit free list - Answer -- allocator uses data structure that contains free blocks
- code: only need to track size of each block
- space(-): potentially more memory needed to store free list
- time(+): a bit faster since just searching through free blocks

Implicit free list - Answer -- allocator uses a "header" block as its D.S.
- code: must track size and status of each heap block
- space(+): potential less memory required
- time(-): more time needed to "skip over" allocated block; O(N) but more alloc. blocks
than free block, so N is larger

Placement policies - Answer -algorithms used to search heap for Free block to satisfy
request

First fit - Answer -- start from: beginning of heap
- stop at: first free block that is big enough
- fail if: END MARK is reached
- mem util(+): like to choose block close to desired size
- throughput(-): requests for large blocks must skip through many smaller blocks

Next fit - Answer -- start from: block most recently allocated
- stop at: first free block that's big enough
- fail if: start block is reached ("wrap-around")
- mem util(-): might choose a block that's too big
- throughput(+): faster than first fit since each request does not start at beginning

Best fit - Answer -- start from: beginning of heap
- stop at: END MARK, and choose block closest to desired size "big enough"
- stop early: if exact size match is found
- fail if: no block found that's big enough
- mem util(+): closest to best size
- throughput(-): slowest in general, since entire heap is searched

False fragmentation - Answer -when there is a large enough contiguous free space, but
it is divided into blocks that are too small to satisfy request

Immediate coalescing - Answer -do every time a block is free'd - check next + prev
block

Delayed coalescing - Answer -do only when needed to satisfy request for a larger block

Footer - Answer -contains size of free block

Pred - Answer -addr of prev free block

Document information

Uploaded on
September 3, 2025
Number of pages
5
Written in
2025/2026
Type
Other
Person
Unknown
$12.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
GEEKA
3.8
(366)
Sold
2162
Followers
1449
Items
60418
Last sold
20 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions