garbage collection with node.js
问题 I was curious about how the node.js pattern of nested functions works with the garbage collector of v8. here's a simple example readfile("blah", function(str) { var val = getvaluefromstr(str); function restofprogram(val2) { ... } (val) }) if restofprogram is long-running, doesn't that mean that str will never get garbage collected? My understanding is that with node you end up with nested functions a lot. Does this get garbage collected if restofprogram was declared outside, so str could not