Memory Allocation Method Reducing Fragmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing memory allocation methods in electronic devices lead to memory fragmentation due to the mixed use of memory blocks of different sizes, resulting in inefficiencies and increased power consumption when large continuous memory blocks are required.
Innovation Solution
The method involves managing memory blocks of different sizes separately by allocating memory from specific regions based on preset capacity ranges, ensuring that memory blocks are allocated from the appropriate region to minimize fragmentation, using a device with a configuration module, comparison module, and allocation module to manage memory blocks effectively.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If memory blocks of different sizes are allocated from the entire memory without distinction, then memory allocation is simple and fast, but memory fragmentation occurs and large continuous memory blocks cannot be obtained
Solution Approach 1:
The patent divides the entire memory into multiple memory regions, where each region is dedicated to storing memory blocks of a specific size range. This segmentation allows the system to efficiently allocate memory blocks of different sizes while maintaining large continuous memory blocks in dedicated regions, thereby preventing fragmentation and ensuring both allocation efficiency and memory continuity.
2Volume of stationary object
If memory compaction is performed to obtain large continuous storage space, then large capacity memory blocks are obtained, but user operations are affected and additional power consumption is caused
Solution Approach 1:
The patent performs preliminary action by pre-dividing memory into regions dedicated to different size ranges before allocation occurs. This ensures that large continuous memory blocks are already available in the large-block memory region when needed, eliminating the need for power-consuming memory compaction operations and avoiding disruption to user operations.
3Device complexity
If memory blocks are allocated without size distinction, then allocation process is simple, but idle memory blocks cannot meet requirements for large-capacity memory allocation
Solution Approach 1:
The patent applies local quality by assigning different characteristics to different memory regions. Each memory region is optimized for specific size ranges, with large-block memory regions maintaining large continuous blocks for large-capacity allocations, while small-block regions handle smaller allocations. This localized optimization ensures sufficient large-capacity memory availability without overly complicating the overall allocation process.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Provided in the embodiments of the present invention are a memory allocation method, apparatus, electronic device, and computer storage medium. The memory of the electronic device comprises a first internal memory region and a second internal memory region. The method comprises: receiving a memory allocation request, said the memory allocation request comprising memory capacity needing to be allocated; comparing the memory capacity that needs to be allocated with the capacity range of a preset memory block to obtain a comparison result; according to the comparison result, allocating a corresponding capacity from the first memory region or the second memory region.