Hi,
In the previous version of Node, I was forcing the garbage collector running node with the flag --expose-gc calling global.gc() in the code. This doesn't seem to work in the version 4.0.
Is there any way to do that?
Thanks.
--js-flags="--expose-gc"
@bricss What?
@jd78 What's the exact problem? Is there no such function or is the memory not collected?
@bricss still not working.
@ChALkeR yes, no function. I get the error "global.gc is not a function"
Still works: node --expose_gc -p global.gc prints [Function: gc], ditto for -p gc.
I see. But the problem persists.
I tried to run the app as follow:
In all cases I get the error when I do global.gc();
The same code was working with the version 12.7.
@jd78 Does just gc() work?
V8 command line switches should come before script filenames. Closing, not a bug.
@bnoordhuis Thanks, that did the job.
Most helpful comment
V8 command line switches should come before script filenames. Closing, not a bug.