当前位置:网站首页>Memory pool (understand the process of new developing space from the perspective of kernel)
Memory pool (understand the process of new developing space from the perspective of kernel)
2022-07-03 02:15:00 【abs(ln(1+NaN))】
Every time we pass new perhaps malloc apply 200 In bytes , Looks like OS It gives us the size we need , In fact, there is a slight difference .
int* p = new int[50];
char* p = (char*)malloc(200);
We're calling new/malloc in the future , In fact, it will go from user mode to kernel mode , Suppose you want to apply for 200 Bytes , At this time, if there is no continuous 200 Bytes of space ,OS Memory processing algorithms may be called , Adjust the position of other variables , Make room for us A big piece Space .
When our users call , Just the results , No matter the process , however OS When calling the memory processing algorithm , It takes time , If we frequently apply for memory later ,OS Also call the processing algorithm frequently , This is inefficient , It's also time-consuming . therefore To improve efficiency , In the first application ,OS The amount of space allocated > The size of our application .
This space is on the user layer , Every time we have to pass new/malloc Application memory , All of them apply to this space , In this case , There is no need to switch states , It will not call memory processing algorithms frequently . This space we call Memory pool !
边栏推荐
- Flink CDC mongoDB 使用及Flink sql解析monggo中复杂嵌套JSON数据实现
- Hard core observation 547 large neural network may be beginning to become aware?
- easyPOI
- MySQL学习03
- Comment le chef de file gère - t - il l'équipe en cas d'épidémie? Contributions communautaires
- Return the only different value (de duplication)
- Learn BeanShell before you dare to say you know JMeter
- 502 (bad gateway) causes and Solutions
- 8 free, HD, copyright free video material download websites are recommended
- [leetcode] 797 and 1189 (basis of graph theory)
猜你喜欢
Performance test | script template sorting, tool sorting and result analysis
可视化yolov5格式数据集(labelme json文件)
stm32F407-------IIC通讯协议
Bottleneck period must see: how can testers who have worked for 3-5 years avoid detours and break through smoothly
Return a tree structure data
Wechat applet development tool post net:: err_ PROXY_ CONNECTION_ Failed agent problem
In 2022, 95% of the three most common misunderstandings in software testing were recruited. Are you that 5%?
8 free, HD, copyright free video material download websites are recommended
Detailed introduction to the deployment and usage of the Nacos registry
A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?
随机推荐
Detailed analysis of micro service component sentinel (hystrix)
Query product cases - page rendering data
stm32F407-------DMA
Flink CDC mongoDB 使用及Flink sql解析monggo中复杂嵌套JSON数据实现
Cfdiv2 fixed point guessing- (interval answer two points)
The testing process that software testers should know
502 (bad gateway) causes and Solutions
使用Go语言实现try{}catch{}finally
Leetcode(540)——有序数组中的单一元素
Analysis, use and extension of open source API gateway apisex
通达OA v12流程中心
DDL basic operation
微服务组件Sentinel (Hystrix)详细分析
Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)
Trial setup and use of idea GoLand development tool
stm32F407-------IIC通讯协议
各国Web3现状与未来
可视化yolov5格式数据集(labelme json文件)
When the epidemic comes, how to manage the team as a leader| Community essay solicitation
[shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)