Akcium
2 years ago

Why it takes so much memory for eloquent models?

Posted 2 years ago by Akcium

I'm not sure if something's wrong with my code or it's normal.

I have a table with 60k rows. When I select them with DB::table('contacts')->get() this line dd(memory_get_peak_usage()/1024/1024); shows that it consumes 250Mb. When I use repositories it consumes 450Mb. Only for 60k rows.

Is it normal or am I missing something?

Please sign in or create an account to participate in this conversation.