当前位置:网站首页>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 !
边栏推荐
- Anna: Beibei, can you draw?
- 5.文件操作
- 【Camera专题】HAL层-addChannel和startChannel简析
- MySQL学习03
- Technology sharing | Frida's powerful ability to realize hook functions
- [Yu Yue education] reference materials of chemical experiment safety knowledge of University of science and technology of China
- Servlet中数据传到JSP页面使用el表达式${}无法显示问题
- [camera topic] how to save OTP data in user-defined nodes
- Codeforces Round #418 (Div. 2) D. An overnight dance in discotheque
- How can retail enterprises open the second growth curve under the full link digital transformation
猜你喜欢

使用Go语言实现try{}catch{}finally

Wechat applet Development Tool Post net:: Err Proxy Connexion Problèmes d'agent défectueux

Asian Games countdown! AI target detection helps host the Asian Games!

stm32F407-------IIC通讯协议

通达OA 首页门户工作台

Return a tree structure data

深度学习笔记(持续更新中。。。)

树形结构数据的处理

The technology boss is ready, and the topic of position C is up to you

A 30-year-old software tester, who has been unemployed for 4 months, is confused and doesn't know what to do?
随机推荐
[camera special topic] Hal layer - brief analysis of addchannel and startchannel
Introduce in detail how to communicate with Huawei cloud IOT through mqtt protocol
[shutter] pull the navigation bar sideways (drawer component | pageview component)
各国Web3现状与未来
Use go language to realize try{}catch{}finally
力扣(LeetCode)183. 从不订购的客户(2022.07.02)
How to find summer technical internship in junior year? Are you looking for a large company or a small company for technical internship?
COM和CN
我的创作纪念日
【CodeForces】CF1338A - Powered Addition【二进制】
require. context
easyExcel
Machine learning notes (constantly updating...)
[Yu Yue education] reference materials of love psychology of China University of mining and technology
SPI mechanism
How to deal with cache hot key in redis
RestCloud ETL 跨库数据聚合运算
微信小程序开发工具 POST net::ERR_PROXY_CONNECTION_FAILED 代理问题
Anna: Beibei, can you draw?
Unrecognized SSL message, plaintext connection?