Bug #68631 [NEW]: opcache_invalidate always increases wasted memory

From: Date: Fri, 19 Dec 2014 17:04:07 +0000
Subject: Bug #68631 [NEW]: opcache_invalidate always increases wasted memory
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189134@lists.php.net to get a copy of this message
From: iquito at gmx dot net Operating system: Debian Wheezy PHP version: 5.5.20 Package: opcache Bug Type: Bug Bug description:opcache_invalidate always increases wasted memory Description: ------------ When calling opcache_invalidate on a script which has not changed since being cached by opcache (and $force is not set), the wasted memory in opcache statistics still increases. I have a cron job which invalidates certain scripts every minute, as they can be changed at any time and then need to be cached again as soon as possible. With the current implementation of opcache_invalidate scenarios such as these lead to the opcache memory being filled within a short time, triggering a restart of opcache and therefore slowing performance needlessly. Test script: --------------- Just call opcache_invalidate on a script which has not changed again and again, and check opcache statistics for the increase in wasted memory. Expected result: ---------------- According to the documentation, a script is only invalidated if the modification time of the script is newer than the cached opcodes. Yet if the wasted memory increases, clearly something is happening or being invalidated. Actual result: -------------- If opcache_invalidate is being called on a script which has not changed, opcache should not have any changes - no invalidation, no increase in wasted memory, no action at all. -- Edit bug report at https://bugs.php.net/bug.php?id=68631&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68631&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68631&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68631&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68631&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68631&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68631&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68631&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68631&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68631&r=support Expected behavior: https://bugs.php.net/fix.php?id=68631&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68631&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68631&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68631&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68631&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68631&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68631&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68631&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68631&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68631&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68631&r=mysqlcfg

« previous php.bugs (#189134) next »