ggreco / testNapi

test garbage collection of node buffer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

testNapi

test (the missing) garbage collection of node buffers created from a NAPI native module in the electron renderer.

To build:

npm install

Tested to leak both on linux and macOS (both with electron 10.x and 11.x).

to run the test:

npm start

Press "leak" and see the memory being exhausted by the electron renderer.

... you can also see the (correct) behaviour of the module in node.js:

npm test

About

test garbage collection of node buffer


Languages

Language:JavaScript 44.3%Language:C++ 27.9%Language:HTML 14.4%Language:Python 13.4%