1. dlmalloc [1]
* Key Points ( salient points )
-
小内存( Small < 0x100 bytes )
-
大内存( Large )
-
超大内存( Huge ) > 64 kb
* Weakness
2. jemalloc ( Android 5.0.0 ~ )
* Key Points ( salient points )
* Summary
3. scudo ( Android 11 ~)
* Key Points ( salient points )
* Summary
4. PartitionAlloc
* Key Points ( salient points )
为了缓解多线程内存分配的数据竞争问题,每个线程的数据缓存区( TLS )保存了少量用于常用中小内存分配的 Slots 。因为这些 Slots 是按线程存储的,所以可以在没有锁的情况下分配它们,并且只需要更快的线程本地存储查找,从而提高进程中的缓存局部性。每个线程的缓存已经过定制以满足大多数请求,通过批量分配和释放第二层的内存,分期锁获取,并在不捕获过多内存的情况下进一步改善局部性。