[Debug] better ouf of memory error handling