Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tacone
· 3y ago · 0 comments
Not 100% sure but just defining those variables outside the loop might have solved.
Comments
[–]
r-spaghetti
3y ago
Or delete them or set to null inside the loop?
[–]
pkolaczk
3y ago
Setting to null doesn't release the memory. It only erases the reference. You still need to wait for the GC to complete.
[–]
baq
3y ago
Side note: it might work in a refcount GC like CPython. That isn’t node though. (It only might because it doesn’t guarantee that memory is actually reused.)