I have two JSON files (one about 40 mb and the second ~30 mb). I include them like this:
$one= json_decode(file_get_contents('../../trigrams.json'), true);
$two= json_decode(file_get_contents('../../fourgrams.json'), true);
On Default i get:
Allowed memory size of 134217728 bytes exhausted (tried to allocate 44 bytes)
I tried
ini_set('memory_limit', '1024M');
Which results in
Allowed memory size of 1073741824 bytes exhausted (tried to allocate 3 bytes)
Could someone please explain these numbers? Why do I need so much memory?
EDIT: The marked duplicate does not solve the problem, since it doesn't explain why the memory usage is so hight for such a relativly small amount of data.
EDIT2: Error is gone when setting
ini_set('memory_limit', '2048M');
But this is not the wanted solution.