jeroenzwart / laravel-csv-seeder

Seed your database with Laravel using CSV files
Other
92 stars 30 forks source link

Seed fails when try to seed from big files. #13

Closed leoneparise closed 4 years ago

leoneparise commented 4 years ago

I'm trying to seed a big (200Mb) CSV file into a table but I keep getting the max memory error. It seems the seeder loads the whole file even if I specify a chunk size. The seed fails on setTotal method, is it possible to get the row total without loading the whole file in memory?

jeroenzwart commented 4 years ago

Chunk is only for inserting to the database. an option maybe useful is to set the total manually. Depending on your php version, but setting for the memory limit is already lower then your CSV file. Did you try with a higher memory limit in your php.ini?