fix(filecache): Move from array_merge to avoid memory exhaustion on large scans#43982
fix(filecache): Move from array_merge to avoid memory exhaustion on large scans#43982
Conversation
Signed-off-by: Git'Fellow <[email protected]>
|
do you know if |
Never tested such approach. In general, EDIT: @icewind1991 i've tested with a simple script, and indeed it uses less memory than
But i'm not familiar with the result of the merge in this case (preservation of keys, associative and indexed arrays...). |
|
I'm not actually sure if |
Summary
When merging large arrays, PHP may require a significant amount of memory, especially if the arrays contain a lot of data.
This can be the case in file scans of large filesystems.
To avoid using
array_mergeand reduce memory consumption, concatenate the arrays using a loop instead.Checklist