[理工] [OS] memory allocation

看板Grad-ProbAsk作者 (doggingg)時間13年前 (2011/01/22 16:53), 編輯推噓2(209)
留言11則, 5人參與, 最新討論串1/1
請教各位大大 For memory allocation algorithms, the "best fit" is always better than "worst fit", yes or no? 解答寫no 可是我個人覺得應該是yes,因為best fit內部碎裂很少,雖然會造成許多外部碎裂, 但都小小的。 而worst fit卻會造成許多大的內部碎裂,所以我想best fit 好像在任何情況都優於 worst fit吧 請各位大大指教一下,並舉個反例,謝謝。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.116.208.80

01/22 17:03, , 1F
mem allocation目前不存在opt best-fit也未必永遠
01/22 17:03, 1F

01/22 17:03, , 2F
好過 first-fit
01/22 17:03, 2F

01/22 17:13, , 3F
best fit在soft real time system 就比較不好了
01/22 17:13, 3F

01/22 17:18, , 4F
糟! 上面我舉錯例子, 你想成有一個process 需要變更
01/22 17:18, 4F

01/22 17:18, , 5F
其size好了...
01/22 17:18, 5F

01/22 17:19, , 6F
另外我覺得best fit, worst fit對於internal fragment
01/22 17:19, 6F

01/22 17:20, , 7F
其副作用是一樣的吧 要比的話 應該只用external比就好
01/22 17:20, 7F

01/22 17:22, , 8F
因為worst fit給行程跟best fit配的記憶體大小是一樣
01/22 17:22, 8F

01/22 17:36, , 9F
謝謝,我懂了
01/22 17:36, 9F

01/22 23:26, , 10F
用一樓的觀念回答就ok了~
01/22 23:26, 10F

09/11 14:10, , 11F
謝謝,我懂了 https://daxiv.com
09/11 14:10, 11F
文章代碼(AID): #1DEfiJIX (Grad-ProbAsk)