Skip to content

[Bug]: Allocation profiling causes the issue on PHP 8.4.* #3360

@mharacewiat

Description

@mharacewiat

Bug report

Description

I'm observing issues with dd-profiling v1.10.0 on PHP 8.4.10 (supposedly on all 8.4.* versions). Tested both CLI and FPM.

Function I use is memory_get_peak_usage, and it seems to behave as expected when extension is disabled and/or when either DD_PROFILING_ENABLED and DD_PROFILING_ALLOCATION_ENABLED are false.

Observations

$  php -v
PHP 8.4.10-dev (cli) (built: Jul 25 2025 09:59:45) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.10-dev, Copyright (c) Zend Technologies
    with datadog-profiling v1.10.0, Copyright Datadog, by Datadog

$ php -r '$x = str_repeat("a", 1024*1024); var_dump(memory_get_peak_usage(false));'
int(0)

$  php -n -r '$x = str_repeat("a", 1024*1024); var_dump(memory_get_peak_usage(false));'
int(1449752)

$  DD_PROFILING_ENABLED=false php -r '$x = str_repeat("a", 1024*1024); var_dump(memory_get_peak_usage(false));'
int(1458040)

$  DD_PROFILING_ALLOCATION_ENABLED=false php -n -r '$x = str_repeat("a", 1024*1024); var_dump(memory_get_peak_usage(false));'
int(1449840)

PHP version

8.4.10

Tracer or profiler version

1.10.0

Installed extensions

[PHP Modules]
Core
datadog-profiling
date
hash
json
pcre
random
Reflection
SPL
standard

[Zend Modules]
datadog-profiling

Output of phpinfo()

datadog-profiling

Version => 1.10.0
Profiling Enabled => true
Profiling Experimental Features Enabled => false
Experimental CPU Time Profiling Enabled => true
Allocation Profiling Enabled => true
Timeline Enabled => true
Exception Profiling Enabled => true
I/O Profiling Enabled => false
Endpoint Collection Enabled => true
Platform's CPU Time API Works => true
Profiling Log Level => off
Profiling Agent Endpoint => http://localhost:8126/
Application's Environment (DD_ENV) =>
Application's Service (DD_SERVICE) => Standard input code
Application's Version (DD_VERSION) =>

Directive => Local Value => Master Value
datadog.profiling.enabled => On => On
datadog.profiling.experimental_features_enabled => Off => Off
datadog.profiling.endpoint_collection_enabled => On => On
datadog.profiling.experimental_cpu_time_enabled => On => On
datadog.profiling.experimental_cpu_enabled => On => On
datadog.profiling.allocation_enabled => On => On
datadog.profiling.experimental_allocation_enabled => On => On
datadog.profiling.allocation_sampling_distance => 4194304 => 4194304
datadog.profiling.timeline_enabled => On => On
datadog.profiling.experimental_timeline_enabled => On => On
datadog.profiling.exception_enabled => On => On
datadog.profiling.experimental_exception_enabled => On => On
datadog.profiling.exception_message_enabled => Off => Off
datadog.profiling.exception_sampling_distance => 100 => 100
datadog.profiling.experimental_exception_sampling_distance => 100 => 100
datadog.profiling.experimental_io_enabled => Off => Off
datadog.profiling.log_level => off => off
datadog.profiling.output_pprof => no value => no value
datadog.profiling.walltime_enabled => On => On
datadog.agent_host => no value => no value
datadog.env => no value => no value
datadog.service => no value => no value
datadog.tags => no value => no value
datadog.trace.agent_port => 0 => 0
datadog.trace.agent_url => no value => no value
datadog.version => no value => no value

Upgrading from

No response

Metadata

Metadata

Labels

🐛 bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions