The invention relates to the technical field of
memory control, and particularly provides a memory
allocation method and
system, a terminal and a storage medium, and the method comprises the steps: configuring a
memory pool based on a
data processing flow and memory demand characteristics; obtaining a basic unit of each calculation unit for
processing data each time, and configuring an address range and a current state for each
memory block based on the determined size of the
memory block in the
memory pool; constructing a balanced binary search tree, and inserting all the memory blocks into nodes of the balanced binary search
tree based on the sizes of the memory blocks; acquiring a memory allocation request, searching an optimal
memory block in the balanced binary search
tree based on the optimal
adaptation strategy for memory allocation, and updating the current state of the optimal memory block to be occupied; and obtaining a memory release request, releasing the corresponding memory block back to the
memory pool, and updating the current state of the released memory block to be idle. Accurate configuration, efficient utilization and flexible management of the memory are achieved, and scientificity and effectiveness of
memory management are effectively improved.