added out of memory errors for most common cases (array and string/bytes)