简体   繁体   中英

memory error while writing a large dataframe to S3 AWS

I have created a dataframe with the following shape using amazon sagemaker.

10612611 rows × 4 columns

All are numeric values. When I am trying to write this dataframe into my S3 bucket as follows, I get memory error.

bytes_to_write = df.to_csv(None).encode()
with s3.open('aws-athena-query-results-xxxxxxx/query_result/xx.csv','wb') as f:
    f.write(bytes_to_write)

MemoryError:

I am using ml.t2.medium for sagemaker instance.

I solved this issue by changing the instance type from ml.t2.medium to ml.t2.2xlarge and it worked perfectly.

The original issue was with the RAM of the instance type and not with S3.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM