当前位置:网站首页>Memory Management
Memory Management
2022-08-04 05:33:00 【学习溢出】
Memory Management
Memory management is the functionality of an operating system which handles or manages primary memory and moves processes back and forth between main memory and disk during execution.
It checks how much memory is to be allocated to processes. It decides which process will get memory at what time.
Process Address Space
The process address space is the set of logical addresses that a process references in its code.
The set of all logical addresses generated by a program is referred to as a logical address space. The set of all physical addresses corresponding to these logical addresses is referred to as a physical address space.
The runtime mapping from virtual to physical address is done by the memory management unit (MMU) which is a hardware device.
Static vs Dynamic Loading
Static loading, the absolute program (and data) is loaded into memory in order for execution to start.
Dynamic loading, dynamic routines of the library are stored on a disk in relocatable form and are loaded into memory only when they are needed by the program.
Fragmentation
As processes are loaded and removed from memory, the free memory space is broken into little pieces. It happens after sometimes that processes cannot be allocated to memory blocks considering their small size and memory blocks remains unused. This problem is known as Fragmentation.
Paging
Paging is a memory management technique in which process address space is broken into blocks of the same size called pages.
Main memory is divided into small fixed-sized blocks of (physical) memory called frames
And the size of a frame is kept the same as that of a page to have optimum utilization of the main memory and to avoid external fragmentation.
Address Translation
Page address is called logical address and represented by page number and the offset.
Logical Address = Page number + page offset
Frame address is called physical address and represented by a frame number and the offset.
Physical Address = Frame number + page offset
Reference
https://www.tutorialspoint.com/operating_system/os_memory_management.htm
边栏推荐
猜你喜欢
随机推荐
实现高并发服务器(二)
调用时序错误导致webrtc无法建立链接
【HIT-SC-MEMO1】哈工大2022软件构造 复习笔记1
淘宝分布式文件系统存储(二)
IDEA创建Servlet步骤
虚幻引擎 5 完整指南[2022六月最新课程学习内容]
MySQL索引
LeetCode_22_Apr_4th_Week
Vmmem process (WSL2) consumes huge amount of memory
C# 剪裁图片内容区域
Object.requireNonNull 方法说明
通用解决端口占用问题
MySQL stored procedure study notes (based on 8.0)
【HIT-SC-MEMO2】哈工大2022软件构造 复习笔记2
【c语言】整数的二进制表现形式是什么?
无一技之长学什么可以做到月入上万?
第九篇 ApplicationContext初始化
C语言静态变量static的分析
淘宝分布式文件系统存储引擎(一)
JUC并发容器——跳表