当前位置:网站首页>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 !
边栏推荐
- 詳細些介紹如何通過MQTT協議和華為雲物聯網進行通信
- Unrecognized SSL message, plaintext connection?
- Groovy, "try with resources" construction alternative
- 我的创作纪念日
- Use go language to realize try{}catch{}finally
- [camera topic] complete analysis of camera dtsi
- 基于线程池的生产者消费者模型(含阻塞队列)
- Cfdiv2 Fixed Point Guessing - (2 points for Interval answer)
- The technology boss is ready, and the topic of position C is up to you
- Unrecognized SSL message, plaintext connection?
猜你喜欢
![[shutter] bottom navigation bar implementation (bottomnavigationbar bottom navigation bar | bottomnavigationbaritem navigation bar entry | pageview)](/img/41/2413af283e8f1db5d20ea845527175.gif)
[shutter] bottom navigation bar implementation (bottomnavigationbar bottom navigation bar | bottomnavigationbaritem navigation bar entry | pageview)

Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)

A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?

Flink CDC mongoDB 使用及Flink sql解析monggo中复杂嵌套JSON数据实现
![[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数](/img/06/ab333a4752de27eae2dd937cf579e2.png)
[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数

Redis:Redis的简单使用

Servlet中数据传到JSP页面使用el表达式${}无法显示问题

树形结构数据的处理

Trial setup and use of idea GoLand development tool

8 free, HD, copyright free video material download websites are recommended
随机推荐
Exception handling in kotlin process
MySQL学习03
[camera topic] turn a drive to light up the camera
The testing process that software testers should know
Flink CDC mongoDB 使用及Flink sql解析monggo中复杂嵌套JSON数据实现
我的创作纪念日
可視化yolov5格式數據集(labelme json文件)
Su Shimin: 25 principles of work and life
[Flutter] dart: class; abstract class; factory; Class, abstract class, factory constructor
Learn BeanShell before you dare to say you know JMeter
微信小程序開發工具 POST net::ERR_PROXY_CONNECTION_FAILED 代理問題
微服务组件Sentinel (Hystrix)详细分析
Cfdiv2 fixed point guessing- (interval answer two points)
Swift development learning
转载收录6.5大侠写的部分Qt开发经验
Trial setup and use of idea GoLand development tool
[Yu Yue education] reference materials of love psychology of China University of mining and technology
The technology boss is ready, and the topic of position C is up to you
Explore the conversion between PX pixels and Pt pounds, mm and MM
SPI机制