fix(prof): revert to more stable hooking for allocation profiling#3361
Merged
realFlowControl merged 1 commit intomasterfrom Jul 28, 2025
Merged
fix(prof): revert to more stable hooking for allocation profiling#3361realFlowControl merged 1 commit intomasterfrom
realFlowControl merged 1 commit intomasterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3361 +/- ##
=======================================
Coverage 61.92% 61.92%
=======================================
Files 140 140
Lines 12356 12356
Branches 1616 1616
=======================================
Hits 7651 7651
Misses 3995 3995
Partials 710 710 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Benchmarks [ profiler ]Benchmark execution time: 2025-07-25 12:24:36 Comparing candidate commit 216b970 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 30 metrics, 6 unstable metrics. |
f88ed8c to
814e59b
Compare
814e59b to
216b970
Compare
bwoebi
approved these changes
Jul 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With #2969 we have added a new way to hook into the ZendMM for allocation profiling. Creating a new
zend_mm_heapstructure makes hooking way easier, but as the actual allocations still happen in the originally installed heap, and calls for stats on ZendMM are not hook-able, calls tomemory_get_peak_usage(false)/memory_get_usage(false)and such will returnint(0).This PR disables the
php_zend_mm_set_custom_handlers_exfeature flag that enables the new hooking mechanism in PHP >= 8.4.0 and as such reverts back to the mechanism used for PHP <= 8.3 to make allocation profiling not interfere with those user land functions.We'll create a follow-up PR to cleanup and use the new hooking mechanism without interfering in this way.
Fixes #3360
Reviewer checklist