|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2019-05-28 10:24 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2019-05-28 10:24 UTC] cmb@php.net
[2019-05-28 15:09 UTC] tyler dot bannister at remote-learner dot net
[2019-05-28 15:13 UTC] cmb@php.net
-Status: Feedback
+Status: Open
-PHP Version: 7.1.29
+PHP Version: 7.2.18
-Assigned To: cmb
+Assigned To:
[2019-05-28 15:13 UTC] cmb@php.net
[2019-05-28 15:43 UTC] tyler dot bannister at remote-learner dot net
[2019-05-28 16:06 UTC] tyler dot bannister at remote-learner dot net
[2020-02-18 14:58 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2020-02-18 14:58 UTC] cmb@php.net
[2020-03-29 22:18 UTC] thedinosaurmail at gmail dot com
[2020-03-31 07:14 UTC] dmitry@php.net
-Assigned To:
+Assigned To: dmitry
[2020-03-31 08:22 UTC] dmitry@php.net
[2021-04-25 02:25 UTC] turchanov at farpost dot com
[2022-12-01 16:34 UTC] cmb@php.net
-Status: Verified
+Status: Duplicate
[2022-12-01 16:34 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 01:00:01 2025 UTC |
Description: ------------ Using the database install script for Moodle 3.2, 3.3, 3.4, 3.5 or Totara 10, 11 or 12 with PHP 7.1.28 or 7.1.29 when opcache is turned on the script runs out of memory even if the memory limit is increased to 2 GB, when opcache is turned off the script uses 78 MB of memory, when opcache is turned on it ran out of memory with 2 GB of memory allowed, at 4 GB of memory the script was killed before it could complete but it looked like it was using all of that memory before it was killed. I suspect that issue is that during installation the Moodle install script does something incredibly stupid, it turns off caching of language strings (it's multi-language system) which means every time it needs to print a message it includes the file that contains the string. Over the course of the database install it ends up including each file hundreds of times and with or without opcache enabled each of those includes seems to increase the amount of memory used, but with opcache enabled the memory usage grows much faster. I've written a pair of simple test scripts to illustrate this behaviour. Test script: --------------- test1.php: <?php print("Starting Memory:". memory_get_usage() ."\n"); for ($x = 1; $x < 10000; $x += 1) { include("test2.php"); } print("Ending Memory:". memory_get_usage() ."\n"); test2.php: <?php $a = "Hello World!\n"; Expected result: ---------------- When test1.php and test2.php are placed in the same directory and the scrits are run with opcache enabled and opcache disabled they should produce roughly the same starting and ending memory sizes. Actual result: -------------- Opcache disabled: Starting Memory:349712 Ending Memory:349872 Opcache enabled: Starting Memory:348856 Ending Memory:7820120