Skip to content

PHP 8.4 doesn’t reserve huge pages on startup #19638

@nisbet-hubbard

Description

@nisbet-hubbard

Description

The following config:

opcache.huge_code_pages=1

Resulted in this output:

# PHP 8.4.12
$ rg -N Huge /proc/meminfo
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:     134
HugePages_Free:       70
HugePages_Rsvd:        5
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:          274432 kB

(The 5 were reserved by mysql.)

But I expected this output instead:

# PHP 8.3.22
$ rg -N Huge /proc/meminfo
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:     134
HugePages_Free:       67
HugePages_Rsvd:       66
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:          274432 kB

Is this a bug or a behaviour change with 8.4?

PHP Version

PHP 8.4.12 (cli) (built: Aug 29 2025 21:57:30) (NTS)                                                            
Copyright (c) The PHP Group                                                                                     
Zend Engine v4.4.12, Copyright (c) Zend Technologies                                                            
    with Zend OPcache v8.4.12, Copyright (c), by Zend Technologies

Operating System

AlmaLinux 10.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions