Appium-memory-collection

Memory Collection

Since Node v. 12 it is possible to collect the dumps of Appium’s memory usage to be analyzed for problems.
This is extremely useful for finding memory leaks.

Creating a dump file

To create a dump file at any given time, add the following command line parameter to node process, which executes the appium.js script:

--heapsnapshot-signal=<signal>

where signal can be one of available custom signals, for example SIGUSR2. Then you will be able to

kill -SIGUSR2 <nodePID>

Dump files are created in the same folder where the main Appium script has been executed.
They have the .heapsnapshot extension, and can be loaded into the Chrome Inspector for further investigation.

Dump file analysis

Read the Rising Stack article for more details.

官方链接为:Memory Collection - Appium