added dynamic 2GB check to heap