Question: Memory Management 3. Memory Management [Total: 25 marks] 3(a) [7 marks] Give an example of the memory leak problem and then explain the meaning of
Memory Management
![Memory Management 3. Memory Management [Total: 25 marks] 3(a) [7 marks] Give](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3b9d727ae0_85466f3b9d68b50d.jpg)
3. Memory Management [Total: 25 marks] 3(a) [7 marks] Give an example of the memory leak problem and then explain the meaning of this problem 3(b) [8 marks] Reference counting and tracing collector are two approaches for managing the heap memory Compare the advantages and the disadvantages of these two approaches 3(c) [10 marks] The following figure shows the content of heap memory in a computer during the execution of a Java program. All the shown addressesumbers are in base-10 (but not in hexadecimal format) Assume that this Java program uses only Node objects Each Node object stores two attributes (an integer called value, and a reference called next), which occupy two consecutive memory cells For example, for the object at address "100", its value attribute is stored at memory cell "100" and its next attribute is stored at memory cell "101". If a next attribute equals to null, then it is displayed as "0 (null)". 103 104 106 Address Content 100 50 101 0 (null 102 21 104 72 105 100 107 122 108 89 110 112 115 113 122 109 114 null (null) 120 17 121 110 122 26 116 123 104 52 106 null) Suppose that the active object references (active pointers) are 100 and 120 Run the mark-sweep garbage collector on the heap memory now Show which memory cells are visited, and which memory cells are garbage
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
