首页 > 试题广场 >

Assume there is an initial 102

[问答题]
Assume there is an initial 1024 KB segment where memory is allocated using the Buddy System. Using Figure 9.27 as a guide, draw the tree illustrating how the following memory requests are allocated:
• request 240 bytes
• request 120 bytes
• request 60 bytes
• request 130 bytes
Next, modify the tree for the following releases of memory. Perform coalescing whenever possible:
• release 240 bytes
• release 60 bytes
• release 120 bytes
推荐
The following allocation is made by the Buddy system: The 240 byte request is assigned a 256 byte segment. The 120 byte request is assigned a 128 byte segement, the 60 byte request is assigned a 64 byte segment and the 130 byte request is assigned a 256 byte segment. After the allocation, the following segment sizes are available: 64 bytes, 256 bytes, 1K, 2K, 4K, 8K, 16K, 32K, 64K, 128K, 256K, and 512K. After the releases of memory, the only segment in use would be a 256 byte segment containing 130 bytes of data. The following segments will be free: 256 bytes, 512 bytes, 1K, 2K, 4K, 8K, 16K, 32K, 64K, 128K, 256K, and 512K.
发表于 2018-03-23 21:58:11 回复(0)