Skip to content

Commit 4018083

Browse files
Fix interned strings buffer check if 0 free bytes
With #32902 it was meant to be avoided to recommend raising the interned strings buffer size above a quarter of the total OPcache size. This works as long as there is at least 1 byte free, but does not apply if the buffer is filled completely. This commit switches the conditions so that the interned strings buffer size must be smaller than a quarter of the total OPcache size for the warning to be shown. That the buffer must be either filled completely or by more than 90% remains untouched. Signed-off-by: MichaIng <[email protected]>
1 parent fef92a0 commit 4018083

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/settings/lib/Controller/CheckSetupController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,11 @@ protected function getOpcacheSetupRecommendations(): array {
524524
}
525525

526526
if (
527-
empty($status['interned_strings_usage']['free_memory']) ||
527+
// Do not recommend to raise the interned strings buffer size above a quarter of the total OPcache size
528+
($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') < $this->iniGetWrapper->getNumeric('opcache.memory_consumption') / 4) &&
528529
(
529-
($status['interned_strings_usage']['used_memory'] / $status['interned_strings_usage']['free_memory'] > 9) &&
530-
// Do not recommend to raise the interned strings buffer size above a quarter of the total OPcache size
531-
($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') < $this->iniGetWrapper->getNumeric('opcache.memory_consumption') / 4)
530+
empty($status['interned_strings_usage']['free_memory']) ||
531+
($status['interned_strings_usage']['used_memory'] / $status['interned_strings_usage']['free_memory'] > 9)
532532
)
533533
) {
534534
$recommendations[] = $this->l10n->t('The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply <code>opcache.interned_strings_buffer</code> to your PHP configuration with a value higher than <code>%s</code>.', [($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?: 'currently')]);

0 commit comments

Comments
 (0)