Search for question
Question

3. Memory fragmentation in C: Design, implement, and execute a C-program that does the

following: It allocates memory for a sequence of 3m arrays of size 500,000 elements each; then it

explicitly deallocates all even-numbered arrays (about 1.5m such arrays) and allocates a sequence

of m arrays of size 700,000 elements each.

Measure the amounts of time your program requires for the allocation of the first sequence and for

the second sequence. You must determine m so that you exhaust almost all of the main memory

available to your program. Explain your timings!!

Fig: 1