Bug #81365 [Opn]: Using OPcache with SHM and file causes 'Allowed memory size of ... bytes exhau'

From: Date: Tue, 17 Aug 2021 14:31:13 +0000
Subject: Bug #81365 [Opn]: Using OPcache with SHM and file causes 'Allowed memory size of ... bytes exhau'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235916@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81365&edit=1 ID: 81365 User updated by: wedwards at cyberfusion dot nl Reported by: wedwards at cyberfusion dot nl Summary: Using OPcache with SHM and file causes 'Allowed memory size of ... bytes exhau' Status: Open Type: Bug Package: opcache Operating System: Debian 10 PHP Version: 7.4.22 Block user comment: N Private report: N New Comment: This seems to be related: https://bugs.php.net/bug.php?id=80864 , the difference being that I'm only seeing this issue with opcache.file_cache_only disabled. > Looks like some kind of memory corruption is occurring in shm+file_cache mode. > The memory exhaustion error is (likely) just the way it manifests. > > I won't be able to diagnose this without some way to reproduce the issue > though. I guess reproducing it should be easy when using PHP 7.4: 1. Enable opcache.file_cache and opcache.file_cache_only 2. Let the OPcache on disk grow (I've seen this issue with OPcache dirs around 120 MiB) 3. Disable opcache.file_cache_only Previous Comments: ------------------------------------------------------------------------ [2021-08-17 13:23:17] nikic@php.net Looks like some kind of memory corruption is occurring in shm+file_cache mode. The memory exhaustion error is (likely) just the way it manifests. I won't be able to diagnose this without some way to reproduce the issue though. ------------------------------------------------------------------------ [2021-08-16 15:23:44] wedwards at cyberfusion dot nl Description: ------------ I recently disabled opcache.file_cache_only (default). opcache.file_cache is set, however. This caused the issue below on 1 out of estimated 100 websites. When using OPcache with SHM Cache *or* File Cache, OPcache works as expected. When using OPcache with SHM Cache *and* File Cache, memory is exhausted: "Allowed memory size of 268435456 bytes exhausted (tried to allocate 70064798980 bytes)" ... followed by PHP-FPM logging the process ended with SIGSEGV. I 'fixed' this issue by physically removing the OPcache directory tree. This leads me to believe the issue is with the size of this website's OPcache, which is 87 MiB (the second largest one is 69 MiB). I expect this issue to reoccur as the OPcache grows. I found one other report of this behaviour (see last lines): https://github.com/Yoast/wordpress-seo/issues/6334#issuecomment-269647620 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81365&edit=1

« previous php.bugs (#235916) next »