US 11,989,420 B2
Memory allocation method and apparatus, electronic device, and storage medium
Junwei Lian, Hefei (CN)
Assigned to Changxin Memory Technologies, Inc., Hefei (CN)
Filed by CHANGXIN MEMORY TECHNOLOGIES, INC., Hefei (CN)
Filed on Jun. 30, 2022, as Appl. No. 17/810,005.
Claims priority of application No. 202210172933.3 (CN), filed on Feb. 24, 2022.
Prior Publication US 2023/0266883 A1, Aug. 24, 2023
Int. Cl. G06F 9/50 (2006.01); G06F 3/06 (2006.01)
CPC G06F 3/0617 (2013.01) [G06F 3/0631 (2013.01); G06F 3/0653 (2013.01); G06F 3/0659 (2013.01); G06F 3/0673 (2013.01); G06F 9/5016 (2013.01); G06F 9/5027 (2013.01)] 12 Claims
OG exemplary drawing
 
1. A memory allocation method, comprising:
obtaining a plurality of memory segments corresponding to a to-be-processed task, and determining a plurality of operation cores in an operation platform that executes the to-be-processed task;
determining a plurality of first-capacity memory segments and a second-capacity memory segment in the plurality of memory segments according to a memory division reference value, wherein a memory capacity of the second-capacity memory segment is greater than a memory capacity of each of the plurality of first-capacity memory segments and greater than or equal to the memory division reference value, and the memory capacity of each of the plurality of first-capacity memory segments is less than the memory division reference value, and the memory division reference value equals a total memory capacity corresponding to the plurality of memory segments divided by an operation core quantity of the plurality of operation cores;
allocating the plurality of first-capacity memory segments one by one to the plurality of operation cores, and determining remaining memory capacities corresponding to the plurality of operation cores respectively; and
allocating the second-capacity memory segment to the plurality of operation cores according to the remaining memory capacities, to obtain a memory allocation result;
wherein the allocating the plurality of first-capacity memory segments one by one to the plurality of operation cores comprises:
using a preset arrangement order of the plurality of first-capacity memory segments as a memory segment arrangement order of the plurality of first-capacity memory segments; and
obtaining an operation core arrangement order of the plurality of operation cores, and allocating the plurality of first-capacity memory segments one by one to the plurality of operation cores according to the memory segment arrangement order and the operation core arrangement order.