Mastering Memory Management: Techniques for Virtual Memory

School
STI College (multiple campuses)**We aren't endorsed by this school
Course
BSIT 305
Subject
Computer Science
Date
Dec 12, 2024
Pages
4
Uploaded by BaronTankKoala51
IT2105 05 Laboratory Exercise 1 *Property of STI Page 1 of 4 LaboratoryExerciseMemoryManagementObjectives: At the end of the exercise, the students should be able to: Examine some techniques in memory partitioning; and Analyze the underlying concepts and implications of virtual memory. Part I (30 points) Instructions: Read the description of the memory configuration and analyze the given diagram. Then, answer the following questions. Memory Configuration: A computer implements a dynamic partitioning technique for memory management. A number of allocation and swapping-out operations have been carried out while the computer is up and running. The diagram below shows the computer's current memory configuration/allocation. The addresses go from left to right. The gray areas represent blocks that are occupied by running processes, while the white areas indicate free memory blocks. The last process that was loaded into the memory is marked with a red X in the diagram, and its size is 2MB. Only one process was swapped out after that. Questions 1. If you are to add a new 10MB process in the memory, where could it possibly be added and why? (5 points) I believe the process on the right side of the 8MB block has already been switched out of RAM, I believe the 8MB plus the amount of the memory on its right side will be sufficient for the new 10MB process. As a result, I believe the new 10MB process will be allocated at the 8MB bar. 2. What could be the size of the free block just before it was partitioned by X? Rationalize your answer. (5 points) In the figure above, the partition with the x mark has a size of 2MB. On the left side, there's a free block with a size of 1MB, and on the right side, there is a free block with a size of 7MB. Based on this, the total free space surrounding the partition is 8MB (1MB on the left + 7MB on the right). 3. Would you suggest the provisioning of virtual memory in this configuration? Why or why not?(5 points)Yes, as the bigger partition will eventually be divided into smaller partitions under the initial variable partition scheme if the smaller processes continue. The following strategies are used to prevent the issue of external fragmentation: compaction, which involves relocating all processes to the top or bottom to create a single continuous area of free memory.
Background image
IT2105 05 Laboratory Exercise 1 *Property of STI Page 2 of 4 4. Is it possible to add a new 7MB process using the first-fit placement algorithm without swapping out any process? Why or why not? (5 points) Yes, the first-fit placement method works by first scanning the memory from the beginning and then selecting the first block that becomes available that is large enough for the process. As you can see in the following image, there is an 8MB block that becomes available, large enough to accommodate the 7MB of process. 5. A new process is requesting a 3MB allocation. Illustrate the possible memory configuration using a horizontal segmented memory strip (like the diagram above), where a partition will be created for the new process under the following placement algorithms: best-fit and first-fit. Label your illustration clearly. (2 items x 5 points) BEST FIT [ 4MB ][ 1MB ][ 5MB ][ 8MB (7MB used, 1MB free) ][ 2MB ][ 4MB ][ 3MB ] FIRST FIT [ 4MB ][ 1MB ][ 5MB ][ 8MB (7MB used, 1MB free) ][ 2MB ][ 4MB ][ 3MB ] Grading Rubric for Essay: Criteria Performance Indicator Points Content Correct ideas and concepts were applied. 3 Organization The presentation of idea was generally organized. 2 TOTAL 5 Grading Rubric for Illustration: Criteria Performance Indicator Points Content The illustration was accurate or plausible. 3 Organization The illustration was presented in an organized manner 2 TOTAL 5
Background image
IT2105 05 Laboratory Exercise 1 *Property of STI Page 3 of 4 Part II (40 points) Instructions: 1. Explain the operation and management of the following virtual memory. Search for relevant studies and literatures that would support your answer. Properly cite your references. (10 points x 2 items) Linux Virtual Memory Virtual memory, or utilizing a disk as an extension of RAM to Increase the effective capacity of usable memory, is supported by Linux. A block of memory. That is not being utilized will have its contents written to the hard drive by the kernel, freeing up the memory for usage in other applications. The original contents are read back into memory whenever they become necessary. The user is not informed of any of this; applications operating under Linux are only aware of the bigger amount of RAM that is available; they are unaware that portions of their programs occasionally live on the disk. Programs don't execute as quickly while reading and writing to the hard drive as they would if they were utilizing actual memory, which is of course far slower. The swap space is the area of the hard drive that is utilized as virtual memory. Windows Virtual Memory The Virtual Memory Manager in Microsoft Windows operating systems. Associates physical memory pages with virtual addresses that are part of an active process's address space. This guarantees that no process tampers with the memory of other processes and that each process has enough virtual memory to operate effectively. The Virtual Memory Manager uses a technique known as demand paging to manage page swapping between RAM and the page. File. As a result, up to 4 GB of RAM may be used by each application. A similar format known as the swap file is used by a similar process in earlier versions of Windows, such as Microsoft Windows 95 and Windows 98. Note: You may also include illustrations from credible sources to better explain your answers. Grading Rubric for Research: Criteria Performance Indicator Points Content Relevant ideas, concepts, illustrations, and/or examples from credible resources were included. 7 Organization The presentation of ideas was generally organized. 3 TOTAL 10 2. Then, answer the following items based on your research. (4 items x 5 points) a. Between the operation and management of Linux and Windows virtual memory, which do you think is less complex and why? Since Windows is the operating system I am more familiar with and is far more advanced than Linux, I believe that to be the case. Additionally, Windows is easier to use than Linux. b. Were you able to find similarities between Linux and Windows virtual memory? oIf your answer is yes, explain each similarity. oIf your answer is no, explain the possible reason why there is no similarity. Their ability to switch processes in different memory and retrieve them when they have sufficient room to do so, in my opinion, is what makes them comparable.
Background image
IT2105 05 Laboratory Exercise 1 *Property of STI Page 4 of 4 c. What are the possible drawbacks of not implementing virtual memory? In my opinion, there's a chance that the computer will lag, particularly if it has al lot of open tasks and RAM isn't big enough to handle them all d. If you are to design a memory management system, would you incorporate virtual memory into your design? Why or why not? Since virtual memory doesn't really improve computer performance, I believe the answer is no. Grading Rubric for Essay: Criteria Performance Indicator Points Content Correct ideas and concepts were utilized. 3 Organization The presentation of ideas was generally organized. 2 TOTAL 5
Background image