Take the code below for example. Assuming the chunk iterator renders 10 chunks, the for loop will load all of them into memory (one after another) or Python will work efficiently releasing one after the oter?
df_iter = pd.read_csv(file, chunksize=100)
for chunk in df_iter:
chunk.to_sql(table, engine)
I've made some tests with files bigger than memory using the code above and got memory overflow. Do I miss something here?