[BEAM-1556] - Size of heap space might be wrongly set
(cherry picked from commit 7a391f3)