当前位置:网站首页>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 !
边栏推荐
- 树形结构数据的处理
- 【Camera专题】HAL层-addChannel和startChannel简析
- A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?
- 浏览器是如何对页面进行渲染的呢?
- His experience in choosing a startup company or a big Internet company may give you some inspiration
- What are the key points often asked in the redis interview
- leetcode961. Find the elements repeated N times in the array with length 2n
- easyExcel
- 转载收录6.5大侠写的部分Qt开发经验
- SPI机制
猜你喜欢

Wechat applet development tool post net:: err_ PROXY_ CONNECTION_ Failed agent problem
![[fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)](/img/ac/bf83f319ea787c5abd7ac3fabc9ede.jpg)
[fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)

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

Recommendation letter of "listing situation" -- courage is the most valuable

机器学习笔记(持续更新中。。。)
![[shutter] hero animation (hero realizes radial animation | hero component createrecttween setting)](/img/e7/915404743d6639ac359bb4e7f7fbb7.jpg)
[shutter] hero animation (hero realizes radial animation | hero component createrecttween setting)
![[camera topic] complete analysis of camera dtsi](/img/cb/d42589fcf0610600c9dc8c7992d4d7.png)
[camera topic] complete analysis of camera dtsi

Learn BeanShell before you dare to say you know JMeter

udp接收队列以及多次初始化的测试

SPI mechanism
随机推荐
The testing process that software testers should know
How to deal with cache hot key in redis
Current situation and future of Web3 in various countries
Swift开发学习
CFdiv2-Fixed Point Guessing-(區間答案二分)
Detailed introduction to the deployment and usage of the Nacos registry
[fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)
Visualisation de l'ensemble de données au format yolov5 (fichier labelme json)
Return the only different value (de duplication)
A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?
[Yu Yue education] China Ocean University job search OMG reference
Modify table structure
Kotlin middle process understanding and Practice (II)
[camera topic] how to save OTP data in user-defined nodes
可視化yolov5格式數據集(labelme json文件)
人脸识别6- face_recognition_py-基于OpenCV使用Haar级联与dlib库进行人脸检测及实时跟踪
elastic stack
Comment communiquer avec Huawei Cloud IOT via le Protocole mqtt
What are the differences between software testers with a monthly salary of 7K and 25K? Leaders look up to you when they master it
udp接收队列以及多次初始化的测试