opcache used_memory reports negative value
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
<?php
var_dump(opcache_get_status()['memory_usage']);
?>
Reports a negative value for 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reproducing opcache_get_status()['memory_usage'] on PHP 8.3 with shared PHP-FPM pools and different opcache.memory_consumption settings; compare the reported values with dedicated PHP-FPM. Done means used_memory remains valid and non-negative in the shared configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100