Seems, that the current setup is too big/expensive to be handled by your machine?
I would check the value of @ciaona_pwm_array first. Is it too big or other than expected?
$seq_1 and $seq_2 seems to stay constant. Are you sure, you're partition the task correctly?
I.e., due to the fork() if you change some global variables, the change will only take place in the copy of the process (child)
and not back-communicated to the parent who should perform the partition task (ok, that's speculation, but perhaps it triggers an idea...?).
Perhaps, you can reduce the memory footprint of the parent before the fork takes place, e.g. let the child read only a chunk of data to be processed?