php / php/php-src

opcache used_memory reports negative value

未关闭
#16,927 4 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Extension: opcache SAPI: fpm Status: Needs Triage
主要语言
C
星标
40.4k
派生
8.1k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

<?php
                var_dump(opcache_get_status()['memory_usage']);
?>

Reports a negative value for used_memory.

used_memory
Image is from a VDS system with opcache.memory_consumption=1GB and several sites.

But issue was reproduced within the following environment:

  • PHP 8.3
  • shared hosting server with PHP-FPM
  • two sites with individual opcache.memory_consumption settings
  • first site: 128M
  • second site: 256M
  • global settings in plesk: 256M

Second site reports correct values, but first site, with lower settings reports negative value for "used_memory"

Changing both sites to dedicated PHP-FPM fixes the issue, but in the default config it fails.

C.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定源文件或测试。首先,在使用共享 PHP-FPM 池和不同 opcache.memory_consumption 设置的 PHP 8.3 上复现 opcache_get_status()['memory_usage'];将报告的值与专用 PHP-FPM 进行比较。在共享配置中 used_memory 保持有效且非负即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, php
领域
backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。