Files related to my CS self study
./malloc.py -n 10 -H 0 -p BEST -s 0 -c
Eventually we end up with size 1 free spaces as there is no coalesce.
When -p WORST
is used, the space doesn’t get congested at first like before. But the final outcome will be same.
Allocation gets fast with -p FIRST
as one doesn’t need to search of the best or worst match.
First fit is not effected by how the list is sorted. Best and worst fit is benefitted from SIZESORT+
and SIZESORT-
respectively. However if we did have coalescing, ADDRSORT
would have helped coalescing.
Without coalescing and with higher -n
we, end up with 1 sized free spaces. Which is not useful at all.
When coalescing is on, ADDRSORT
obviously gives the best result with all of the fitting policies.
The other two sorting with coalescing:
Worst fit performs bad with either sorting. This is because the smaller free spaces doesn’t get used until the larger free spaces get all chopped up. Over time, with sorting, these free spaces get separated from their contagious spaces. Which doesn’t let them get coalesced. A different coalescing algorithm could solve this problem, but would coalescing much more time costly.
Best fit performs similarly with either sorting. Because smaller spaces get used more frequently and thus contagious spaces gets to stay together more compared to worst fit approach.
First fit with size sorting is just either worst fit or best fit. So, gives same result as them result.
If P
is higher than 50 the system gets full eventually. When it is below 50, the simulator still produces 50% allocation requests. Because one cant not free memory that is not allocated.
Not possible with address sorting and coalescing on.
./malloc.py -c -A +10,+15,+20,+25,+30,-0,-1,-2,-3,-4
./malloc.py -c -A +10,+15,+20,+25,+30,-0,-1,-2,-3,-4 -l SIZESORT+ -C
./malloc.py -c -A +10,+15,+20,+25,+30,-0,-1,-2,-3,-4 -l SIZESORT- -C