@Sinnbeck I know, but for the testing I want to see some stuff and behavior (just for learning), realistically I am not going to do it.
I increased the allowed memory from 512M to 1024M in the php.ini and it worked. But still, why? If it said it tried to allocate much less than the limit of 512M.
Also, when checking the size of resources in the devtools, the 100,000 rows are 74.0 MB, much less than 512M
@Sinnbeck Oh true, I just thought that since in this case I actually dumped the entire $data to the HTML it could be close (because I output everything in the blade using {{ $data }})
So doing what you suggested work, but I wanted to actually display the data in the HTML page
@Sinnbeck So where does the 27267072 bytes come from? From the string size that it tries to dump to the HTML, but the actual data size is much bigger? Also, I tried to do this:
dd(mb_strlen(serialize((array)$data), '8bit'));
and it shows 188384164 (Bytes? so 188 MB?)
And MySQL WorkBench shows only 16MiB,
So everything shows different size, that's why I don't understand which is the actual data size.
Ok I can understand that PHP tries to allocate probably more than the actual data size, but the numbers are way off? And changing all the time
Let me give an example that might help your understanding.
Imagine that you wrote a python script that went through every single file on your computer, and checked the path, name, file size and file type and stored these values in foo.txt. It opens all files to check them for errors no matter the size. It also keeps track of all files it has opened so far. Now this script might use 600 mb of memory (ram) as it needs to remember every single thing. But the resulting foo.txt might only be 10mb. See the difference?
Of course php doesn't do this exact thing. It's just an e example