Closed categoryshell closed 5 years ago
When indexing multiple files, for example within a for loop, there is excessive memory usage which could cause PHP to run into memory issues.
By adding fclose() on the file resource, after performing the cURL request, memory usage can be decreased a lot.
On 10 iterations with the file samples/sample5.pdf Without fclose():
samples/sample5.pdf
Iteration 0 960M Iteration 1 960M Iteration 2 960M Iteration 3 960M Iteration 4 960M Iteration 5 960M Iteration 6 960M Iteration 7 960M Iteration 8 960M Iteration 9 960M Iteration 10 960M
And after adding fclose():
Iteration 0 192M Iteration 1 192M Iteration 2 192M Iteration 3 192M Iteration 4 192M Iteration 5 192M Iteration 6 192M Iteration 7 192M Iteration 8 192M Iteration 9 192M Iteration 10 192M```
You're right @JBleijenberg, a fclose() must be added. Will make some tests and merge for the next release.
When indexing multiple files, for example within a for loop, there is excessive memory usage which could cause PHP to run into memory issues.
By adding fclose() on the file resource, after performing the cURL request, memory usage can be decreased a lot.
On 10 iterations with the file
samples/sample5.pdf
Without fclose():And after adding fclose():