Skip to content

Commit 2f594c4

Browse files
add v4.0.0 release notes for external mem tracking to readme
1 parent c6bfa80 commit 2f594c4

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ opencv4nodejs
2323
* **[Quick Start](#quick-start)**
2424
* **[Async API](#async-api)**
2525
* **[With TypeScript](#with-typescript)**
26+
* **[External Memory Tracking (v4.0.0)](#external-mem-tracking)**
2627
* **[Available Modules](#available-modules)**
2728
* **[Request new Features](#request-features)**
2829

@@ -458,6 +459,25 @@ import * as cv from 'opencv4nodejs'
458459

459460
Check out the TypeScript [examples](https://github.com/justadudewhohacks/opencv4nodejs/tree/master/examples/typed).
460461

462+
<a name="external-mem-tracking"></a>
463+
464+
# External Memory Tracking (v4.0.0)
465+
466+
Since version 4.0.0 external memory tracking will be enabled by default. Simply put, the memory allocated for Matrices (cv.Mat) will be manually reported to the node process. This solves the issue of inconsistent Garbage Collection, which could have resulted in spiking memory usage of the node process eventually leading to overflowing the RAM of your system, prior to version 4.0.0.
467+
468+
Note, that in doubt this feature can be **disabled** by setting and environment variable `OPENCV4NODEJS_DISABLE_EXTERNAL_MEM_TRACKING` before requiring the module:
469+
470+
``` bash
471+
export OPENCV4NODEJS_DISABLE_EXTERNAL_MEM_TRACKING=1 // linux
472+
set OPENCV4NODEJS_DISABLE_EXTERNAL_MEM_TRACKING=1 // windows
473+
```
474+
475+
Or directly in your code:
476+
``` javascript
477+
process.env.OPENCV4NODEJS_DISABLE_EXTERNAL_MEM_TRACKING = 1
478+
const cv = require('opencv4nodejs')
479+
```
480+
461481
<a name="available-modules"></a>
462482

463483
# Available Modules

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"dependencies": {
4141
"macro-inferno": "^0.2.1",
4242
"nan": "^2.7.0",
43-
"native-node-utils": "0.0.3",
43+
"native-node-utils": "0.0.4",
4444
"opencv-build": "0.0.11"
4545
}
4646
}

0 commit comments

Comments
 (0)