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
Copy file name to clipboardExpand all lines: README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,6 +191,25 @@ The `examples/` directory at the root of the repository contains more detailed e
191
191
192
192
php examples/objects_list.php
193
193
194
+
## Information on structs size
195
+
Display size in byte of main data structs size in PHP. Will mainly differ between 32bits et 64bits environments.
196
+
197
+
```php
198
+
meminfo_structs_size(fopen('php://stdout','w'));
199
+
```
200
+
201
+
It can be useful to understand difference in memory usage between two platforms.
202
+
203
+
Example Output on 64bits environment:
204
+
205
+
```
206
+
Structs size on this platform:
207
+
Class (zend_class_entry): 568 bytes.
208
+
Object (zend_object): 32 bytes.
209
+
Variable (zval): 24 bytes.
210
+
Variable value (zvalue_value): 16 bytes.
211
+
```
212
+
194
213
Usage in production
195
214
-------------------
196
215
PHP Meminfo can be used in production, as it does not have any impact on performances outside of the call to the `meminfo` functions.
@@ -200,7 +219,7 @@ Nevertheless, production environment is not where you debug ;)
200
219
Other memory debugging tools for PHP
201
220
-------------------------------------
202
221
- XDebug (https://xdebug.org/)
203
-
With the trace feature and the memory delta option (see XDebug documentation), you can trace function memory usage. You can use the provided script to get an aggregated view (TODO link)
222
+
With the trace feature and the memory delta option (tool see XDebug documentation), you can trace function memory usage. You can use the provided script to get an aggregated view (TODO link)
0 commit comments