Move large buffers from stack to heap

This commit moves a number of large buffers from stack to heap to fix
crashes due to stack overflow.

Change-Id: I9d1592e4f6dbfa18a475d0fc5674f6d3632f39ed
3 files changed