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 |
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.
|