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
+22-10Lines changed: 22 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,6 @@ The extension tracks the allocation and release of memory blocks to report the a
12
12
* Dumps profile in callgrind, pprof, or raw array formats
13
13
* Can track memory allocated by PHP itself as well as native malloc
14
14
15
-
### How does it differ from Blackfire ?
16
-
17
-
Blackfire measures peak memory during function calls, while Memprof focuses on leaked memory. This makes Memprof more accurate when trying to find the cause of a high memory usage.
18
-
19
-
An other difference is that Memprof can track native memory, like the memory allocated by libxml when using the DOM extension.
20
-
21
15
## Install
22
16
23
17
### Dependencies
@@ -81,9 +75,27 @@ This can be done multiple times during the same execution, if necessary.
81
75
82
76
### 3. Visualizing the profile
83
77
84
-
The profile can be visualised with Kcachegrind, Qcachegrind, Google Perftools,
85
-
or with custom tools. See the documentation of ``memprof_dump_callgrind()``
86
-
and variants.
78
+
The recommended way to visualize the result is to use Kcachegrind (on Linux) or Qcachegrind (on MacOS, Windows). Google Perftools are also supported. See the documentation of ``memprof_dump_callgrind()`` and variants.
79
+
80
+
#### Install Kcachegrind on Linux
81
+
82
+
Most distributions have a `kcachegrind` package ready to be installed.
83
+
84
+
For example, Ubuntu or Debian:
85
+
86
+
```
87
+
sudo apt install kcachegrind
88
+
```
89
+
90
+
Other distributions most likely have a package ready to be installed as well.
91
+
92
+
#### Install Qcachegrind on MacOS
93
+
94
+
Use Homebrew: https://formulae.brew.sh/formula/qcachegrind
95
+
96
+
#### Install Qcachegrind on Windows
97
+
98
+
Download it from https://sourceforge.net/projects/qcachegrindwin/
87
99
88
100
### Usage example
89
101
@@ -124,7 +136,7 @@ Returns whether memory profiling is currently enabled (see above).
124
136
### memprof_dump_callgrind(resource $stream)
125
137
126
138
Dumps the current profile in callgrind format. The result can be visualized with tools such as
127
-
[KCacheGrind][2] or [QCacheGrind][6].
139
+
[KCacheGrind](#install-kcachegrind-on-linux) or [QCacheGrind](#install-qcachegrind-on-macos).
0 commit comments