当前位置:网站首页>Chapter 17 free space management
Chapter 17 free space management
2022-06-13 04:56:00 【CCSUZB】
The problems to be solved in this chapter are :
To meet variable length allocation requests , How to manage free space ? What strategies can minimize fragmentation ? How about the time and space cost of different methods ?
17.1 hypothesis
A data structure that manages free space on the heap is often called a free list (free list). This structure contains references that manage all free blocks in the memory area .
17.2 Underlying mechanism
- Split and merge
- Track the size of allocated space
- Embed free list
- Let the heap grow
17.3 Basic strategy
- The best match : First, traverse the entire free list , Find a free block of the same or larger size as the request , And then go back to the smallest one in the group .
- The worst match :, It tries to find the largest free block , After segmenting and meeting user needs , Put the remaining blocks ( It's big ) Join the free list
- Match for the first time : Find the first big enough block , Return the requested space to the user
- Next time match : A pointer , Point to where the last lookup ended
17.4 The other way
Detach the free list : If an application frequently applies for one ( Or several ) Size of memory space , So use a separate list , Only manage objects of this size . Requests of other sizes are allocated to more general memory allocators
Buddy system : In this system , Free space is first conceptually considered to be the size of 2N The big space . When there is a memory allocation request , Free space is recursively split in two , Until it just meets the size of the request ( It's not enough to divide into two ). At this time , The requested block is returned to the user .
边栏推荐
- Crawler scrapy framework learning 2
- 2021TPAMI/图像处理:Exploiting Deep Generative Prior for Versatile Image Restoration and Manipulation
- Configuration used by automatic teaching evaluation script
- Collection of some compatibility issues
- D 小红的构造题
- [JS solution] leedcode 117 Populate the next right node pointer II for each node
- The games that you've tasted
- Third party comment plugin
- Colab使用教程(超级详细版)及Colab Pro/Pro+评测
- Internet people a few years ago vs Internet people today
猜你喜欢

Colab使用教程(超级详细版)及Colab Pro/Pro+评测

如何只用4步,实现一个自定义JDBC驱动?

Interpretation of QT keypressevent

Normal distribution (Gaussian distribution)

Cesium:CesiumLab制作影像切片与切片加载

Leetcode game 297 (20220612)

Section 2 - branch and loop statements

C disk lossless move file
![[try to hack] upload labs (temporarily write to 12)](/img/df/dbb78121f7428e25ffb73cfc43ce1b.png)
[try to hack] upload labs (temporarily write to 12)

Advanced C - Section 2 - pointers
随机推荐
[JS solution] leedcode 117 Populate the next right node pointer II for each node
CMB's written test -- data analysis
自动评教脚本使用的配置
Elliptic curve encryption
Advantages of win8.1 and win10
小C的记事本
PostgreSQL Guide: inside exploration (Chapter 10 basic backup and point in time recovery) - Notes
Collection of some compatibility issues
PostgreSQL Guide: Insider exploration (Chapter 7 heap tuples and index only scanning) - Notes
Regular expressions in QT
rainbow
Hidden implementation and decoupling, knowing Pimpl mode
Recommended temporary online image compression tool
Cesium:CesiumLab制作影像切片与切片加载
2021TPAMI/图像处理:Exploiting Deep Generative Prior for Versatile Image Restoration and Manipulation
Explain the role of key attribute in V-for
Section 8 - Practical commissioning techniques
Converting MySQL data to PostgreSQL with Navicat
Tita performance treasure: remote one-on-one discussion
Spread your wings and soar