Question 71
HardWhich allocation strategy is usually fastest?
- A.
They are always equal
- B.
Worst fit
- C.
First fit
- D.
Best fit
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
Which allocation strategy is usually fastest?
They are always equal
Worst fit
First fit
Best fit
Sign up free to see the answer and a step-by-step explanation.
What does a slab allocator in an OS kernel do?
Keeps caches of pre-initialised objects of the same size for fast allocation
Manages swap space
Schedules processes
Allocates whole disks
Sign up free to see the answer and a step-by-step explanation.
What does a garbage collector do?
Defragments the disk
Frees memory that is still in use
Deletes unused files
Automatically frees memory that the program can no longer reach
Sign up free to see the answer and a step-by-step explanation.
Why is the stack usually placed at the top of a process's address space, growing down, with the heap growing up?
It is required by the CPU
So both can grow towards each other into the same free space
Because stacks are larger
Because the heap is read-only
Sign up free to see the answer and a step-by-step explanation.
What is address space layout randomisation (ASLR) for?
Making it harder for attackers to predict where code and data are in memory
Reducing fragmentation
Saving swap space
Speeding up memory access
Sign up free to see the answer and a step-by-step explanation.
A system uses fixed partitions of 100 KB. Processes of 70, 90, 45 and 100 KB are loaded into four partitions. What is the total internal fragmentation?
105 KB
0 KB
30 KB
95 KB
Sign up free to see the answer and a step-by-step explanation.
What does the 50-percent rule say about first fit?
Half the requests fail
First fit is half as fast as best fit
For N allocated blocks, about N/2 blocks are lost to fragmentation
Memory is half full at all times
Sign up free to see the answer and a step-by-step explanation.
Which hardware unit translates logical addresses to physical ones at run time?
The memory management unit (MMU)
The ALU
The DMA controller
The disk controller
Sign up free to see the answer and a step-by-step explanation.
Swapping a 100 MB process out to a disk with 50 MB/s transfer and 8 ms latency, and swapping another 100 MB process in, takes about how long?
About 8 ms
About 2 seconds
About 4 seconds
About 1 second
Sign up free to see the answer and a step-by-step explanation.
Why do modern systems rarely swap whole processes?
Paging moves individual pages, which is much more efficient
Processes are too small
Disks are too small
Swapping is forbidden
Sign up free to see the answer and a step-by-step explanation.