Go to file
openharmony_ci 3c90a50267
!79 代码规范整改-给私有变量增加下划线
Merge pull request !79 from 周梦杰/zmj-20230626-modify-private-variable
2023-07-18 12:04:22 +00:00
figures fix README and Architecture Images 2022-03-01 14:48:06 +08:00
libdmabufheap add chipsetsdk 2023-07-13 09:56:44 +08:00
libmeminfo warning clean 2023-07-06 19:08:32 +08:00
libpurgeablemem !79 代码规范整改-给私有变量增加下划线 2023-07-18 12:04:22 +00:00
purgeable_builder !88 reuse threadpool when making purgeable pixelmap 2023-07-14 02:00:09 +00:00
bundle.json Hitrace component dependency rectification 2023-06-20 20:27:24 +08:00
LICENSE fix repository normative issues 2022-02-23 16:30:27 +08:00
OAT.xml delete OAT.xml's useless code 2022-03-01 15:29:13 +08:00
purgeable_mem_config.gni add purgeable builder to support purgeable pixelmap 2023-06-04 19:52:52 +08:00
README_ZH.md !44 在readme.md中添加libpurgeable库信息 2022-09-30 02:08:59 +00:00
README.md !44 在readme.md中添加libpurgeable库信息 2022-09-30 02:08:59 +00:00

The Part of Memory Base Libraries

Introduction

The part of Memory base libraries belongs to the subsystem named Utils Subsystem. It provides the system library for upper-layer services to operate memory, ensuring the stability of upper-layer services.

Architecture

Figure 1 Memory Base Libraries architecture

Memory Base Libraries User
libdmabufheap multimedia service
libmeminfo memory manager service
libmemleak memory manager service
libpurgeable graphic service
libspeculative system service (planning)

Directory Structure

/utils/memory
├── libdmabufheap           # DMA (Direct Memory Access) memory allocation system library
│   ├── include             # DMA memory allocation system library header directory
│   ├── src                 # DMA memory allocation system library source directory
│   └── test                # DMA memory allocation system library usecase directory
├── libmeminfo              # Memory footprint management library
├── libmemleak              # Memory leak detection library
├── libpurgeable            # Purgeable memory management library
└── libspeculative          # Speculative memory management library

Memory Base Libraries

Memory base libraries is a component of the system library that integrates memory operations and manages them in a unified manner.

libdmabufheap system library

The memory system library provides interfaces for the multimedia service to allocate and share shared memory. By allocating and sharing memory between hardware devices and user space, zero-copy memory between devices and processes is implemented to improve execution efficiency.

libmeminfo system library (planning)

It provides interfaces for memory usage queries. It is used for memory footprint query, low memory killing and other scenarios.

libmemleak system library (planning)

It cooperates with malloc_debug to detect memory leaks of native heap.

libpurgeable system library

It provides a dedicated memory request interface for discardable type memory for multimedia related services. When the available memory of the system is insufficient, the purgeable memory is directly discarded by the system to achieve rapid memory recovery. When the application is used again, the purgeable memory that has been freed can be rebuilt.

libspeculative system library (planning)

It provides management interfaces for speculative-type memory. It is mainly used by system services for data pre-loading.

Usage Guidelines

System developers can add or remove this part by configuring the product definition JSON file under /productdefine/common/products to enable or disable this part:

"commonlibrary:memory_utils":{}

Repositories Involved

utils