memlab 1.1.9-alpha → 1.1.12-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/bin/memlab +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ for analyzing heap snapshots taken from Chrome/Chromium, Node.js, Hermes, and El
|
|
|
9
9
|
Install the CLI
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install -g
|
|
12
|
+
npm install -g memlab
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
### Find Memory Leaks
|
|
@@ -25,11 +25,13 @@ function url() {
|
|
|
25
25
|
|
|
26
26
|
// action where we want to detect memory leaks: click the Hotels button
|
|
27
27
|
async function action(page) {
|
|
28
|
+
// puppeteer page API
|
|
28
29
|
await page.click('button[aria-label="Hotels"]');
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
// action where we want to go back to the step before: click clear search
|
|
32
33
|
async function back(page) {
|
|
34
|
+
// puppeteer page API
|
|
33
35
|
await page.click('[aria-label="Clear search"]');
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -47,7 +49,7 @@ If you want to use a self-defined leak detector, add a `filterLeak` callback
|
|
|
47
49
|
in the scenario file. `filterLeak` will be called for every unreleased heap
|
|
48
50
|
object (`node`) allocated by the target interaction.
|
|
49
51
|
|
|
50
|
-
```
|
|
52
|
+
```javascript
|
|
51
53
|
function filterLeak(node, heap) {
|
|
52
54
|
// ... your leak detector logic
|
|
53
55
|
// return true to mark the node as a memory leak
|
|
@@ -55,6 +57,7 @@ function filterLeak(node, heap) {
|
|
|
55
57
|
```
|
|
56
58
|
|
|
57
59
|
`heap` is the graph representation of the final JavaScript heap snapshot.
|
|
60
|
+
For more details, view the [doc site](https://facebookincubator.github.io/memlab).
|
|
58
61
|
|
|
59
62
|
### Heap Analysis and Investigation
|
|
60
63
|
|
package/bin/memlab
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memlab",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.12-alpha",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "memlab is a framework that analyzes memory and finds memory leaks in JavaScript applications.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"typescript": "^4.6.3"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
|
+
"preinstall": "node bin/preinstall",
|
|
53
54
|
"build-pkg": "tsc",
|
|
54
55
|
"clean-pkg": "rm -rf ./dist && rm -rf ./node_modules && rm -f ./tsconfig.tsbuildinfo"
|
|
55
56
|
},
|