php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75175 Opcache_reset() does not clear cache
Submitted: 2017-09-08 14:56 UTC Modified: 2017-11-05 04:22 UTC
From: tm8544 at hotmail dot com Assigned:
Status: No Feedback Package: opcache
PHP Version: 7.2.0RC1 OS: Windows 10 x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tm8544 at hotmail dot com
New email:
PHP Version: OS:

 

 [2017-09-08 14:56 UTC] tm8544 at hotmail dot com
Description:
------------
After opcache_reset, with version 7.2.0RC1 "used_memory" still occupies much more memory than with version 7.1.9. Opcache runtime configuration stays the same.

Expected result shows test script output with PHP 7.1.9,
and actual result shows test script output with PHP 7.2.0RC1.

Test script:
---------------
<html><body><pre><?php 

echo "Memory Usage before reset:\r\n";
$a = opcache_get_status();
var_dump($a["memory_usage"]);
echo "----------------------\r\n";
echo "Reset Opcache\r\n";
$ok = opcache_reset();
var_dump($ok);
echo "----------------------\r\n";
echo "Memory Usage after reset:\r\n";
$a = opcache_get_status();
var_dump($a["memory_usage"]);

?></pre></body></html>

Expected result:
----------------
Memory Usage before reset:
array(4) {
  ["used_memory"]=>
  int(701384)
  ["free_memory"]=>
  int(133516344)
  ["wasted_memory"]=>
  int(0)
  ["current_wasted_percentage"]=>
  float(0)
}
----------------------
Reset Opcache
bool(true)
----------------------
Memory Usage after reset:
array(4) {
  ["used_memory"]=>
  int(701384)
  ["free_memory"]=>
  int(133516344)
  ["wasted_memory"]=>
  int(0)
  ["current_wasted_percentage"]=>
  float(0)
}



Actual result:
--------------
Memory Usage before reset:
array(4) {
  ["used_memory"]=>
  int(18272056)
  ["free_memory"]=>
  int(115945672)
  ["wasted_memory"]=>
  int(0)
  ["current_wasted_percentage"]=>
  float(0)
}
----------------------
Reset Opcache
bool(true)
----------------------
Memory Usage after reset:
array(4) {
  ["used_memory"]=>
  int(18272056)
  ["free_memory"]=>
  int(115945672)
  ["wasted_memory"]=>
  int(0)
  ["current_wasted_percentage"]=>
  float(0)
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-13 10:28 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2017-09-13 10:28 UTC] ab@php.net
Thanks for the report. I'm not sure to understand the issue. The numbers for used_memory are in both cases equal before and after reset. They differ in different PHP versions, but that doesn't tell anything about the opcache_reset() functionality. It only tells that something has changed in other PHP version, which is an implementation detail. Please be more specific.

Thanks.
 [2017-11-05 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 07:01:28 2024 UTC