PHP: array chunk where each chunk is not more than a fixed memory size

I have an array

$profileIds = [1, 2, 3, 4, 5, 6, 7, .............., 8000];

I want to get the minimum number of array chunks like [1,2,3], [4,5,6,7,8], [9, 10, 11, 12] where each chunk size is not more than fixed memory size i.e. 200KB. Thanks in advance.

I am getting the size of the array in bytes by doing:

$bytes = mb_strlen(serialize($array), '8bit');