{ "q08": { "type": "multiple", "question": "\n\nWhich of the following statements regarding strategies for growing the heap\nare true (select all that apply)?\n\n\n", "responses": { "bestfit": "Best fit is effective and has low costs.", "segregated": "Segregated lists are used to separate memory requests from different processes.", "buddy": "Buddy allocators always allocate memory in pairs to ensure future requests are possible.", "nextfit": "Next fit keeps track of where the OS left off in the free list and returns next available block.", "worstfit": "Worst fit is prone to excess fragmentation and has high overheads.", "firstfit": "First fit finds the first available block and returns it." } }, "q02": { "type": "blank", "question": "\n\nIn virtualizing memory, the OS has three major goals:\n\n\n\n
    \n
  1. ____: The virtualization should ensure processes are guarded from one another as well as the OS itself.
  2. \n
  3. ____: The virtualization should be invisible to the running program.
  4. \n
  5. ____: The virtualization should be as effective as possible in terms of space and time.
  6. \n
\n" }, "q03": { "type": "order", "question": "\nAn address space is usually divided into four components:\n\n\n
    \n
  1. Contains data that is the instructions of the program.
  2. \n
  3. Contains data that is implicitly or automatically managed by the compiler.
  4. \n
  5. Contains data that is explicitly or manually managed by the user.
  6. \n
  7. Contains data that is statically allocated by the program.
  8. \n
\n\nOrder the following labels to match the components described above.\n", "responses": { "code": "Code", "data": "Data", "stack": "Stack", "heap": "Heap" } }, "q01": { "type": "blank", "question": "\n\nAs with the CPU, the operating system ____ or abstracts memory by providing\nan illusion of a large and private ____ to each process. To maintain this\nillusion, the OS will need some hardware help to translate pretend ____\naddresses into real ____ addresses. \n\n\n" }, "q06": { "type": "blank", "question": "\n\n\nIn the technique known as ____, we use two hardware registers: a ____\nregister which sets the starting point, and a ____ register which sets the\nlimit of our addresses. This information is used by the ____ in the\nprocessor to translate addresses using the following formula:\n\n\n\n
\n\nphysical address = ____ + virtual address\n\n
\n\n\n\nUnfortunately, this technique suffers from an inefficiency known as ____,\nwhich means that space inside an allocated unit is not completely utilized\n(and thus wasted).\n\n\n" }, "q07": { "type": "blank", "question": "\n\nTo manage free space, the operating system usually maintains a data\nstructure called the ____ to keep track of which memory units are available\n(or in use). When a request for memory is made, the OS can use a technique\ncalled ____, which involves locating a free chunk of memory and dividing it\ninto two. Conversely, when memory is returned, the OS can perform ____ to\ncombine contiguous free space.\n\n\n" }, "q04": { "type": "order", "question": "\n\nThe following are descriptions of various memory errors:\n\n\n\n
    \n
  1. Illegal memory access.
  2. \n
  3. Not allocating enough memory.
  4. \n
  5. Forgetting to initialize allocated memory.
  6. \n
  7. Forgetting to free allocated memory.
  8. \n
  9. Freeing memory before you are done with it.
  10. \n
  11. Freeing memory repeatedly.
  12. \n
  13. Incorrectly freeing memory.
  14. \n
\n\nOrder the following labels to match the descriptions above.\n", "responses": { "segfault": "Segmentation Fault", "uninitread": "Uninitialized Read", "memleak": "Memory Leak", "dangling": "Dangling Pointer", "double": "Double Free", "overflow": "Buffer Overflow", "invalid": "Invalid Free" } }, "q05": { "type": "blank", "question": "\n\nTo implement virtual memory, operating systems typically use ____, where\nthe hardware transforms each ____ by redirecting the referenced address to\nthe actual location in physical memory. The OS participates in this\nillusion by setting up the hardware to ensure correct translation takes\nplaces and by ____, that is keeping track of which locations are free and\nwhich are in use.\n\n" } }