当前位置:网站首页>System memory introduction and memory management
System memory introduction and memory management
2022-07-23 23:09:00 【Listen to the bleak rain at night】
1、 Why need to manage memory ?
Computer memory resources are limited , The processes running in the system are infinite , So , The computer cannot run too many processes , If there are too many running processes , There will be electricity Brain performance decreases , Even due to limited resources , The new process does not work properly .
2、 What is memory management ?
Memory management is system management The memory space between each running process is independent , It can run normally .
The spatial address allocation mechanism of each process is existing , Each process is in Kernel mode and User mode Each has a Stack , When the process is running in user mode , The user state space used by the process ; When running in kernel mode , When using kernel space .
a: What is kernel state ? What is user mode ?
In a nutshell , Kernel mode operation permission is high , The operation permission of user mode is low . Kernel mode can directly operate all resources of the system , Such as operating various hardware devices . User status can be achieved through API Function to operate hardware devices and memory . The mechanism of user mode and kernel mode provides the stability and availability of the operating system .

b: How does the system manage memory ?
The system goes through Virtual memory _ Baidu Encyclopedia (baidu.com) Technology to manage memory , How virtual memory works 、 Please refer to Baidu Encyclopedia for scheduling methods . Virtual memory mechanism is equivalent to memory manager , The main things to do are :(1) Allocate independent virtual space to each process , The memory addresses between each process do not affect each other .(2) Realize the mapping mechanism from virtual space address to actual hardware physical address .(3) The page missing exception mechanism is introduced to realize the inert allocation of memory .(4) Get into swap Mechanism , Switch inactive data to disk .
The mapping relationship between virtual address and physical address is reflected by page table , A page table is equivalent to a map , Memory management unit received CPU After the virtual address of , The corresponding physical address can be determined by querying the page table . For specific introduction, please refer to 40 Zhang diagram | Linux The mysterious past behind the memory
There is a good article on memory management, see : That's great ! 20 Here's a picture to uncover the fog of memory management , Suddenly the light came out
3、 Introduction to basic knowledge
The memory distribution is as follows :

I'll add later .
边栏推荐
- 砺夏行动|源启数字化:既有模式,还是开源创新?
- QT set cache and compile output path
- 系列文章|云原生时代下微服务架构进阶之路 - 微服务拆分的最佳实践
- Rails搭配OSS最佳实践
- 20. Valid parentheses valid parentheses
- ES6箭头函数的使用
- Debian | Can’t locate Debian/Debhelper/Sequence/germinate. pm in @INC
- 狂神redis笔记10
- (CVPR-2022)BiCnet
- Diabetes genetic risk testing challenge advanced
猜你喜欢

Diabetes genetic risk testing challenge advanced

J9 number theory: how can we overcome the fomo phenomenon in the digital industry?

At the forefront of the times, Huawei aims at the wind and sea of digital finance

Microsoft SQL Server database language and function usage (XIII)

TAP 系列文章6 | TAP的应用模型

作为开发,你不得不知道的三个性能测试工具|Jmeter、Apipost、JMH使用指南

1、 Simplification of digital logic
![[leetcode ladder] linked list · 203 remove linked list elements](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[leetcode ladder] linked list · 203 remove linked list elements

Series of articles | the way to advance the microservice architecture in the cloud native era - best practices of microservice splitting

Analysis of mobile semantics and perfect forwarding
随机推荐
Can Intel NUC replace the host_ It's finally perfect! The latest Intel NUC Mini host comes online
TAP 系列文章5 | 云原生构建服务
Upgrade unity visual studio 2019 to 2022 (throw away pirated red slag)
视频号加强打击低俗内容:对违背公序良俗的内容必须赶尽杀绝
ES6箭頭函數的使用
[nuxt 3] (IX) server routing
Notes on network segment CIDR
1000 okaleido tiger launched binance NFT, triggering a rush to buy
As a developer, you have to know the three performance testing tools JMeter, API and jmh user guide
Sword finger offer II 115. reconstruction sequence
TAP 系列文章6 | TAP的应用模型
1、 Simplification of digital logic
Series of articles | the way to advance the microservice architecture in the cloud native era - best practices of microservice splitting
[leetcode ladder] the penultimate node in the 022 linked list
Rails with OSS best practices
Open source embedded sig in the openeuler community. Let's talk about its multi OS hybrid deployment framework
D1-h development board - Introduction to Nezha development
The I2C interface mode offline burning operation method of h7-tool has been released (2022-07-16)
The font of Siyuan notes is thinner and lighter than that in other editors (atom, VSC, sublime)
Wechat applet implements a global event bus by itself