add profile.memory service documentation (#15441)

This commit is contained in:
Jason Hunter 2020-10-28 21:05:46 -04:00 committed by GitHub
parent 3d597bb5b7
commit 5cd428a576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,3 +33,20 @@ Additionally, the profiler will generate a `callgrind.out` file that can be view
[kcachegrind](https://kcachegrind.github.io/) or qcachegrind [kcachegrind](https://kcachegrind.github.io/) or qcachegrind
### Service `profiler.memory`
Start the memory profiler for the specified number of seconds.
| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `seconds` | yes | The number of seconds to run the profile. Defaults to 60.0
When the memory profile is complete, Profiler will generate a `.hpy` file in your configuration directory. The exact path to these files will appear in a persistent notification so they can be easily located and copied to your desktop.
The `hpy` file can be viewed with any text editor. A visual representation can be viewed using the [Heapy Profile Browser](http://guppy-pe.sourceforge.net/ProfileBrowser.html) which is a part of the guppy3 package and can be launched via the below script:
```python
#! /usr/bin/python3
from guppy import hpy
hpy().pb()
```