Answer the question
In order to leave comments, you need to log in
Why doesn't DELETE work in NodeJs?
Here is the code
var a, b, c, d, e, h;
b = new Array(10000000).join('lalalalalalalalalalalala');
d = new Array(10000000).join('lalalalalalalalalalalala');
c = new Array(10000000).join('lalalalalalalalalalalala');
e = new Array(10000000).join('lalalalalalalalalalalala');
h = new Array(10000000).join('lalalalalalalalalalalala');
a = new Array(10000000).join('lalalalalalalalalalalala');
aa = 5
delete a, b, c, d, e, h, aa;
console.log(aa)
Answer the question
In order to leave comments, you need to log in
As far as I know, Node.js uses a garbage collector that monitors the device's RAM and triggers cleanup at a certain overflow level. Try to run an infinite loop, inside which the object is created and then nulled.
If you want extreme sports, you can read about the --expose-gc flag.
It will help you clean memory at the right time, but is not recommended for production use.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question