You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Memprof doesn't track native allocations by default, but this can be enabled
136
+
by setting `MEMPROF_PROFILE` to `native`.
137
+
138
+
Native allocations are the allocations made outside of PHP's own memory
139
+
allocator. Typically, external libraries such as libxml2 (used in the DOM
140
+
extension) make native allocations. PHP can also make native allocations for
141
+
persistent resources.
142
+
143
+
Enabling native allocation tracking will profile these allocations in addition
144
+
to PHP's own allocations.
145
+
146
+
Note that when native tracking is enabled, the program will crash if a native
147
+
library uses threads, because the underlying hooks are not thread safe.
148
+
130
149
## Functions documentation
131
150
132
151
### memprof_enabled()
133
152
134
153
Returns whether memory profiling is currently enabled (see above).
135
154
155
+
### memprof_enabled_flags()
156
+
157
+
Returns whether memory profiling and native profiling are enabled (see above).
158
+
136
159
### memprof_dump_callgrind(resource $stream)
137
160
138
161
Dumps the current profile in callgrind format. The result can be visualized with tools such as
@@ -265,7 +288,6 @@ Example output:
265
288
266
289
## Troubleshooting
267
290
268
-
* If you are experiencing crashes, try disabling malloc hooks by setting HAVE_MALLOC_HOOKS to 0 in config.h after running configure; then run ``make clean && make && make install``. (Using malloc hooks may crash if some other extension uses threads internally.)
269
291
* The extensions may conflict with xdebug, blackfire, or other extensions. If that's the case for you, please report it.
270
292
271
293
## PHP versions
@@ -274,10 +296,6 @@ The current branch supports PHP 7.1 to PHP 8.
zend_error(E_WARNING, "Calling memprof_enable() manually may not work as expected because of PHP optimizations. Prefer using MEMPROF_PROFILE=1 as environment variable, GET, or POST");
0 commit comments