memlab 1.0.5-alpha → 1.0.8-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 +10 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
# memlab
|
|
2
2
|
|
|
3
|
-
memlab is an E2E testing and analysis framework for finding memory
|
|
4
|
-
in
|
|
5
|
-
|
|
6
|
-
and Electron.js.
|
|
3
|
+
memlab is an E2E testing and analysis framework for finding JavaScript memory
|
|
4
|
+
leaks in Chromium. The CLI Toolbox and library provide extensible interfaces
|
|
5
|
+
for analyzing heap snapshots taken from Chrome/Chromium, Node.js, Hermes, and Electron.js.
|
|
7
6
|
|
|
8
7
|
## CLI Usage
|
|
9
8
|
|
|
10
9
|
Install the CLI
|
|
11
10
|
|
|
12
11
|
```bash
|
|
13
|
-
npm install -g
|
|
12
|
+
npm install -g memlab
|
|
14
13
|
```
|
|
15
14
|
|
|
16
|
-
To find memory leaks in Google Maps, create a scenario file defining how
|
|
17
|
-
|
|
15
|
+
To find memory leaks in Google Maps, you can create a scenario file defining how
|
|
16
|
+
to interact with the Google Maps, let's name it `test-google-maps.js`:
|
|
18
17
|
|
|
19
18
|
```javascript
|
|
20
19
|
// Visit Google Maps
|
|
@@ -35,7 +34,7 @@ async function back(page) {
|
|
|
35
34
|
module.exports = {action, back, url};
|
|
36
35
|
```
|
|
37
36
|
|
|
38
|
-
Now run memlab with the scenario file, memlab will
|
|
37
|
+
Now run memlab with the scenario file, memlab will interact with
|
|
39
38
|
the web page and show detected memory leaks:
|
|
40
39
|
|
|
41
40
|
```bash
|
|
@@ -53,9 +52,9 @@ Analyze pre-fetched v8/hermes `.heapsnapshot` files:
|
|
|
53
52
|
memlab analyze unbound-object --snapshot-dir <DIR_OF_SNAPSHOT_FILES>
|
|
54
53
|
```
|
|
55
54
|
|
|
56
|
-
Use `memlab analyze` to view all memory analyses. For extension, view the [doc site](/tba).
|
|
55
|
+
Use `memlab analyze` to view all built-in memory analyses. For extension, view the [doc site](/tba).
|
|
57
56
|
|
|
58
|
-
View
|
|
57
|
+
View retainer trace of a particular object:
|
|
59
58
|
```bash
|
|
60
59
|
memlab report --nodeId <HEAP_OBJECT_ID>
|
|
61
60
|
```
|
|
@@ -64,7 +63,7 @@ Use `memlab help` to view all CLI commands.
|
|
|
64
63
|
|
|
65
64
|
## APIs
|
|
66
65
|
|
|
67
|
-
Use the `memlab`
|
|
66
|
+
Use the `memlab` package to start a E2E run in browser and detect memory leaks:
|
|
68
67
|
|
|
69
68
|
```javascript
|
|
70
69
|
const memlab = require('memlab');
|