MindMap Gallery memory management
This is a mind map about memory management. The main contents include: swapping and overwriting, continuous allocation storage management method, program loading and linking, and memory hierarchy.
Edited at 2024-10-24 00:28:27魯米:靈性覺醒的10個維度。當你停止尋找自己,便會找到整個宇宙,因為你正在尋找的東西,也在尋找你。任何你每天持之以恆在做的事情,都可以為你打開一扇通向精神深處的門。靜默中,我滑入祕境,萬般皆妙樂觀察身邊的神奇,不要聲張。你生而有翼,為何喜歡爬行?靈魂擁有了它自己的耳朵,能夠聽到頭腦無法理解的事情。向內尋求一切的答案吧,宇宙中的一切都在你體內。情人們並不最終相遇某處,這個世界沒有離別。傷口是光進入你內心的地方。
慢性心力衰竭,不僅僅是心率的快慢問題!它源於心肌收縮與舒張功能的下降,導致心輸出量不足,進而引發肺循環充血和體循環淤血。從病因、誘因到代償機制,心衰的病理生理過程複雜多樣。通過控制水腫、減輕心臟前後負荷、改善心臟舒縮功能,以及防治基本病因,我們可以有效應對這一挑戰。了解心衰的機制與臨床表現,掌握防治策略,才能更好地守護心臟健康。
缺血再灌注損傷是器官或組織恢復血液供應後,細胞功能代謝障礙和結構破壞反而加重的現象。其主要機制包括自由基生成增多、鈣超載以及微血管和白細胞的作用。心臟和腦是常見的受損器官,表現為心肌代謝和超微結構變化、心功能下降等。防治措施包括清除自由基、減輕鈣超載、改善代謝和控制再灌注條件,如低鈉、低溫、低壓等。理解這些機制有助於製定有效治療方案,減輕缺血性損傷。
魯米:靈性覺醒的10個維度。當你停止尋找自己,便會找到整個宇宙,因為你正在尋找的東西,也在尋找你。任何你每天持之以恆在做的事情,都可以為你打開一扇通向精神深處的門。靜默中,我滑入祕境,萬般皆妙樂觀察身邊的神奇,不要聲張。你生而有翼,為何喜歡爬行?靈魂擁有了它自己的耳朵,能夠聽到頭腦無法理解的事情。向內尋求一切的答案吧,宇宙中的一切都在你體內。情人們並不最終相遇某處,這個世界沒有離別。傷口是光進入你內心的地方。
慢性心力衰竭,不僅僅是心率的快慢問題!它源於心肌收縮與舒張功能的下降,導致心輸出量不足,進而引發肺循環充血和體循環淤血。從病因、誘因到代償機制,心衰的病理生理過程複雜多樣。通過控制水腫、減輕心臟前後負荷、改善心臟舒縮功能,以及防治基本病因,我們可以有效應對這一挑戰。了解心衰的機制與臨床表現,掌握防治策略,才能更好地守護心臟健康。
缺血再灌注損傷是器官或組織恢復血液供應後,細胞功能代謝障礙和結構破壞反而加重的現象。其主要機制包括自由基生成增多、鈣超載以及微血管和白細胞的作用。心臟和腦是常見的受損器官,表現為心肌代謝和超微結構變化、心功能下降等。防治措施包括清除自由基、減輕鈣超載、改善代謝和控制再灌注條件,如低鈉、低溫、低壓等。理解這些機制有助於製定有效治療方案,減輕缺血性損傷。
memory management
memory hierarchy
register
CPU internal storage unit
Fastest access
Used to store temporary data and intermediate results
Cache
Located between CPU and main memory
Used to reduce the latency of CPU access to main memory
Divided into different levels such as L1, L2, L3 etc.
Main memory (RAM)
random access memory
Used to store operating systems, applications and data
Volatile storage, data is lost after power outage
Auxiliary storage (hard disk, SSD)
non-volatile storage
For long-term storage of data and programs
Slower than main memory, larger capacity
disk cache
Program loading and linking
Program compilation
precompiled
Processing preprocessing directives
compile
Translate preprocessed files into assembly language
compilation
Convert assembly language into machine language and generate target code
Program link
link process
Link the compiled object module and the required library functions together to form a total load module
Link method
static link
definition
Before running the program, link each target module and required library functions into a complete load module, which will not be disassembled later.
Features
The resulting executable is larger, but runs without additional loading and linking steps.
advantage
Improve program execution speed and reduce compatibility
Dynamic linking on load
definition
When the program is loaded into memory, it is linked while loading. That is, when an external module is found to be called, the module is immediately loaded and linked.
Features
Facilitates modification and updating of modules in the program without reopening the entire loaded module.
Dynamic linking at runtime
definition
Links to certain target modules are only performed when the module is needed during program execution.
Features
Memory space can be saved because only the currently needed modules are loaded.
Program loading
absolute mount mode
Definition: At compile time, if the specific location in memory where the program will reside is known, the compiler will produce object code with an absolute address.
Features: The logical address in the program is exactly the same as the actual memory address, without address conversion.
Applicable scenarios: single-program environment, memory usage is simple and clear.
Relocatable load mode
Definition: Load the load module into the appropriate location in memory, and relocate (i.e. modify) the address in the module when loading.
Features: Allows the program to be loaded into any location in the memory, but the address is fixed when loading and cannot be moved during operation.
Applicable scenarios: Multi-programming environment, where the final location of the program loaded into memory cannot be predicted during compilation.
Dynamic runtime loading mode
Definition: After the program is loaded into the memory, the address translation is not performed immediately, but the address translation is performed when the program is actually executed.
Features: Allows the program's location in memory to dynamically change, requiring the support of a relocation register.
Applicable scenarios: Scenarios that require programs to move frequently in memory, such as systems that support the swap function.
Address binding and memory protection
logical address
physical address
memory protection
Continuous allocation storage management method
definition
Allocate a contiguous memory space to the user process to ensure that the logical addresses in the program are also adjacent in physical memory.
Main distribution methods
single contiguous allocation
Features: The simplest memory management method, suitable for single-programming environments. The memory is divided into system area and user area. The user area has only a separate partition for user programs to use.
Advantages and Disadvantages: Advantages: Simple and easy to implement, no external debris. Disadvantages: It can only be used in single-user, single-task operating systems, with low memory utilization and large internal fragmentation.
Fixed partition allocation
Memory partitioning
Divide the user memory space into several fixed-size partitions. Only one job can be mounted per partition.
Partition size
Equal size: suitable for controlling multiple identical objects, but lacks flexibility. Different sizes: improve flexibility and divide into multiple small partitions, an appropriate number of medium partitions, and a small number of large partitions.
Advantages and Disadvantages
Advantages: Can be used in multiprogramming systems, no external fragmentation. Disadvantages: Large internal fragmentation, low storage space utilization, and lack of flexibility.
Dynamic partition allocation
Advantages and Disadvantages
Advantages and Disadvantages: Advantages: Improved memory utilization and high flexibility. Disadvantages: prone to external fragmentation and requiring complex memory management strategies.
Swapping and overwriting
swap
Definition: Swap usually refers to the exchange of positions or states between two or more elements.
characteristic: Bidirectionality: An exchange involves movement or change in two directions. Reversibility: The swapped state can be restored to the original state by swapping again.
cover
Definition: Covering means that one element or set is replaced or obscured by another element or set.
characteristic: Unidirectionality: Overwriting is usually a one-way process, where a new element or collection replaces an old one. Irreversibility: Once overwriting occurs, the original state may not be fully restored.