hce_nsysu
113年
計算機概論與程式設計
第 43 題
Which of the following items is NOT features of Dynamic Loading?
- A The program is loaded in the memory when it's needed during the execution.
- B It reduces memory usage and improves performance.
- C Program is not linked and compiled before being loaded in memory.
- D The complete program is loaded into the main memory before it is executed.
- E None of the above.
思路引導 VIP
想像你正在設計一個擁有一百個功能的龐大軟體,但使用者的電腦記憶體非常有限。如果我們在軟體剛開啟、使用者還沒開始操作時,就強行將這一百個功能的程式碼全部塞進 RAM 裡,這對系統效率會產生什麼影響?這種「一次到位」的做法,與我們想要「節省資源」的目標是否存在矛盾呢?
🤖
AI 詳解
AI 專屬家教
恭喜你答對了!這顯示你對作業系統中記憶體配置的機制有相當清晰的邏輯,能準確區分不同的載入策略。
動態載入的核心機制
在**動態載入(Dynamic Loading)**的環境下,程式的常式(routines)並不會在啟動時就全部塞進記憶體。相反地,它們會以可重新定位(relocatable)的形式儲存在磁碟上。只有當主程式明確呼叫到某個特定功能時,系統才會檢查該常式是否已在記憶體中;若不在,才會將其載入並更新鏈結。這種「隨傳隨到」的特性(如選項 A),能有效避免載入那些在執行過程中可能根本不會被用到的程式碼(例如錯誤處理或罕見功能),進而優化記憶體使用率(如選項 B)。
▼ 還有更多解析內容