Bug #78076 [Opn->Ver]: Opcache greatly increases memory usage.

From: Date: Tue, 18 Feb 2020 14:58:20 +0000
Subject: Bug #78076 [Opn->Ver]: Opcache greatly increases memory usage.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225612@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78076&edit=1

 ID:                 78076
 Updated by:         cmb@php.net
 Reported by:        tyler dot bannister at remote-learner dot net
 Summary:            Opcache greatly increases memory usage.
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            opcache
 Operating System:   Centos 7.4.1708
 PHP Version:        7.2.18
 Block user comment: N
 Private report:     N

 New Comment:

I can confirm the reported behavior (PHP 7.3 and 7.4 on Windows 10).


Previous Comments:
------------------------------------------------------------------------
[2019-05-28 16:06:47] tyler dot bannister at remote-learner dot net

I've continued testing the problem, and on the command line I was able to stop the memory
explosion in my test script by setting opcache.file_cache_only=0.

However, I only enabled that setting in the first place to deal with the problem of running out of
memory with the Moodle installer.  So the issue isn't exclusive to having file_cache_only
enabled, but maybe that setting makes the problem worse?

The minimal number of non-default settings to replicate (on my now Centos 7.6.1810 with PHP 7.3.5
system) seems to be:
opcache.enable=1
opcache.enable_cli=1
opcache.file_cache="/var/lib/php/cli-opcache"
opcache.file_cache_only=1

I was also able to replicate the problem on Ubuntu 18.04.2 with PHP 7.2.17:
Opcache enabled with opcache.file_cache_only enabled:
Starting Memory:389008
Ending Memory:7860232

Opcache enabled with opcache.file_cache_only disabled:
Starting Memory:388432
Ending Memory:388432

Opcache disabled:
Starting Memory:389992
Ending Memory:390144

------------------------------------------------------------------------
[2019-05-28 15:43:12] tyler dot bannister at remote-learner dot net

PHP 7.28 actual output:
Opcache enabled:
Starting Memory:385248
Ending Memory:7856480

Opcache disabled:
Starting Memory:386104
Ending Memory:386232

PHP 7.3.5 actual output:
Opcache enabled:
Starting Memory:389112
Ending Memory:8450224

Opcache disabled:
Starting Memory:389904
Ending Memory:390088

------------------------------------------------------------------------
[2019-05-28 15:13:54] cmb@php.net

Thanks!

------------------------------------------------------------------------
[2019-05-28 15:09:32] tyler dot bannister at remote-learner dot net

I was able to confirm the problem also exists in PHP 7.2.18.

------------------------------------------------------------------------
[2019-05-28 10:24:32] cmb@php.net

PHP 7.1 receives only security fixes.  Can you reproduce the issue
with any of the actively supported PHP versions[1].

[1] <https://www.php.net/supported-versions.php>

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=78076


--
Edit this bug report at https://bugs.php.net/bug.php?id=78076&edit=1


Thread (11 messages)

« previous php.bugs (#225612) next »