Skip to content

Cannot allocate memory with tracing JIT on 8.4.4 #17868

Closed

Description

@jbcollings

Description

The following errors occur approximately 30% to 40% of the time on PHP 8.4.4 when JIT is enabled with CRTO trigger set to 5 (tracing) and an optimization level greater than or equal to 2. This issue occurs only on 8.4.4 and is not reproducible on 8.4.3 with any JIT configuration. The issue does not occur on 8.4.4 when tracing JIT is disabled.

mmap() failed: [12] Cannot allocate memory
PHP Fatal error:  Out of memory (allocated 5325709312 bytes) (tried to allocate 884818088 bytes)
Error: Allowed memory size of 6442450944 bytes exhausted (tried to allocate 18446744072005976232 bytes)

It will also simply terminate with the message Killed and no further details (rarely).

Steps to reproduce:

Run the following command using any standard Symfony application with debug=false. The issue does not appear to occur when debug=true.

php bin/console cache:clear --env=prod

PHP Version

8.4.4

Operating System

Rocky Linux 8/9

Activity

  1. ndossche commented on Feb 20, 2025

    @ndossche
    Member

    (tried to allocate 18446744072005976232 bytes)

    This seems similar to an error found in #17866, coincidentally, also uses a symfony component and the issue also appeared in 8.4.4...
    I'll try to have a look.
    EDIT: op_array->cache_size looks like a garbage value...
    EDIT 2: bisect points to 28b448a but that doesn't seem like the root cause, I think it only revealed this bug and this bug is older.

  2. self-assigned this
    on Feb 20, 2025
  3. added a commit that references this issue on Feb 20, 2025
    0df4547
  4. added 2 commits that reference this issue on Feb 24, 2025
    8e9df32
    5ede541
  5. jbcollings commented on Feb 25, 2025

    @jbcollings
    Author

    Thank you @nielsdos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions