WL-3056 Make sure we don't risk running out of heap