Computers and Technology
Computers and Technology, 09.04.2020 22:01, dymi6n

For question 1, I think the heap allocator allocates from higher addresses(at the end) to lower addresses(at the beginning).

and for question 2 and 3, I chose best fit for question 2 and none of the above for question 3, but not sure.

Need clear explanation for this kind of cases.



sizes between addresses = 1024, 64, 1024, 512, 1024, 128, 1024, 64, 1024
Question #1

If invoking the program as

memory 480,0,0,0
produced this output:

0 | 1024 | 1088 | 2112 | 2624 | 3648 | 3776 | 4800 | 4864 |

The 480-byte chunk was allocated at address 2144
would you conclude that the heap allocator allocates new chunks of RAM at the beginning (i. e., lower addresses) or at the end (i. e., higher addresses) of holes in memory? Why? To explain why just use a contraposition argument (e. g., if the heap allocator did X then Y would have happened, but instead Z happened).

Whatever the heap allocator does, this is what we assume it does for all subsequent questions.

Question #2

If invoking the program as

./memory 100,200,100,80
produces this output:

0 | 1024 | 1088 | 2112 | 2624 | 3648 | 3776 | 4800 | 4864 |

The 100-byte chunk was allocated at address 2524
The 200-byte chunk was allocated at address 2324
The 100-byte chunk was allocated at address 2224
The 80-byte chunk was allocated at address 3696
would you say that the heap allocator uses

first fit

best fit

worst fit

none of the above?

Question #3

If invoking the program as

./memory 40, 400, 80, 60
produces this output:

0 | 1024 | 1088 | 2112 | 2624 | 3648 | 3776 | 4800 | 4864 |

The 40-byte chunk was allocated at address 3736
The 400-byte chunk was allocated at address 2224
The 80-byte chunk was allocated at address 2144
The 60-byte chunk was allocated at address 4804
would you say that the heap allocator uses

first fit

best fit

worst fit

none of the above?

Question #4

After looking up some documentation, you find out that the heap allocator uses worst fit! What would the output of the memory program be when invoked as follows:

./memory 400, 100, 10, 10

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, Dweath50
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server. so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
image
Computers and Technology, 22.06.2019 22:30, Metlife
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, mjweed3381
Cloud computing service providers manage different computing resources based on the services they offer. which resources do iaas and paas providers not manage? iaas providers do not manage the for the client, whereas paas providers usually do not manage the for their clients. iaas- storage server operating system network paas- applications interafce storage vertualiation
Answers: 2
image
Computers and Technology, 24.06.2019 01:10, jaileen84
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates. json” file), in order of closest-to-farthest from the origin.
Answers: 1
Do you know the correct answer?
For question 1, I think the heap allocator allocates from higher addresses(at the end) to lower addr...

Questions in other subjects:

Konu
Mathematics, 22.03.2021 19:50
Konu
Mathematics, 22.03.2021 20:00