Skip to content

Commit f215dc7

Browse files
authored
Update README.md
1 parent 54490de commit f215dc7

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ The extension tracks the allocation and release of memory blocks to report the a
1212
* Dumps profile in callgrind, pprof, or raw array formats
1313
* Can track memory allocated by PHP itself as well as native malloc
1414

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-
2115
## Install
2216

2317
### Dependencies
@@ -81,9 +75,27 @@ This can be done multiple times during the same execution, if necessary.
8175

8276
### 3. Visualizing the profile
8377

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/
8799

88100
### Usage example
89101

@@ -124,7 +136,7 @@ Returns whether memory profiling is currently enabled (see above).
124136
### memprof_dump_callgrind(resource $stream)
125137

126138
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).
128140

129141
``` php
130142
<?php

0 commit comments

Comments
 (0)