From 5cd428a576fc62fa4c7006f4e428794b01188ece Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Wed, 28 Oct 2020 21:05:46 -0400 Subject: [PATCH] add profile.memory service documentation (#15441) --- source/_integrations/profiler.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/_integrations/profiler.markdown b/source/_integrations/profiler.markdown index 6ffad5a8b7b..ce36523f91b 100644 --- a/source/_integrations/profiler.markdown +++ b/source/_integrations/profiler.markdown @@ -33,3 +33,20 @@ Additionally, the profiler will generate a `callgrind.out` file that can be view [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() +```