memlab 1.1.33 → 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.
Files changed (2) hide show
  1. package/README.md +14 -3
  2. package/package.json +2 -2
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
- **Self-defined leak detector**: If you want to use a self-defined leak detector, add a `filterLeak` callback
100
- ([doc](https://facebook.github.io/memlab/docs/api/interfaces/core_src.IScenario/#-optional-beforeleakfilter-initleakfiltercallback))
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 filterLeak(node, heap) {
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memlab",
3
- "version": "1.1.33",
3
+ "version": "1.1.35",
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",
@@ -54,7 +54,7 @@
54
54
  "scripts": {
55
55
  "preinstall": "node bin/preinstall",
56
56
  "build-pkg": "tsc",
57
- "publish-patch": "npm version patch --force && npm publish",
57
+ "publish-patch": "echo 'require manual publish: run npm publish in packages/memlab'",
58
58
  "clean-pkg": "rm -rf ./dist && rm -rf ./node_modules && rm -f ./tsconfig.tsbuildinfo"
59
59
  },
60
60
  "devEngines": {