memlab 1.1.34 → 1.1.35
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 +14 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -96,13 +96,24 @@ with readable variables, function name, and property names on objects).
|
|
|
96
96
|
Alternatively, you can debug the leak by loading the heap snapshot taken by memlab (saved in `$(memlab get-default-work-dir)/data/cur`)
|
|
97
97
|
in Chrome DevTool and search for the leaked object ID (`@182929`).
|
|
98
98
|
|
|
99
|
-
**
|
|
100
|
-
|
|
99
|
+
**View Retainer Trace Interactively**
|
|
100
|
+
|
|
101
|
+
View memory issues detected by memlab based on a single JavaScript
|
|
102
|
+
heap snapshot taken from Chromium, Hermes, memlab, or any node.js
|
|
103
|
+
or Electron.js program:
|
|
104
|
+
```bash
|
|
105
|
+
memlab view-heap --snapshot <PATH TO .heapsnapshot FILE>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
You can optionally specify a specific heap object with the object's id: `--node-id @28173` to pinpoint a specific object.
|
|
109
|
+
|
|
110
|
+
**Self-defined leak detector**: If you want to use a self-defined leak detector, add a `leakFilter` callback
|
|
111
|
+
([doc](https://facebook.github.io/memlab/docs/api/interfaces/core_src.IScenario/#-optional-leakfilter-leakfiltercallback))
|
|
101
112
|
in the scenario file. `filterLeak` will be called for every unreleased heap
|
|
102
113
|
object (`node`) allocated by the target interaction.
|
|
103
114
|
|
|
104
115
|
```javascript
|
|
105
|
-
function
|
|
116
|
+
function leakFilter(node, heap) {
|
|
106
117
|
// ... your leak detector logic
|
|
107
118
|
// return true to mark the node as a memory leak
|
|
108
119
|
};
|