There's an interesting possible problem when upgrading from node 0.10 to node 4: It seems like running code via vm.runInNewContext retains the whole context, including all native constructors, globals, etc.. From our current testing it looks like those are never collected even after nothing in our app code holds a reference to any object belonging to the context, leading to the process running out of memory eventually. After we stopped using vm.runInNewContext, the problem went away.
As mentioned above, we have only circumstantial evidence that the leak is in vm.runInNewContext itself.
Reactions are currently unavailable
There's an interesting possible problem when upgrading from node 0.10 to node 4: It seems like running code via vm.runInNewContext retains the whole context, including all native constructors, globals, etc.. From our current testing it looks like those are never collected even after nothing in our app code holds a reference to any object belonging to the context, leading to the process running out of memory eventually. After we stopped using vm.runInNewContext, the problem went away.
As mentioned above, we have only circumstantial evidence that the leak is in vm.runInNewContext itself.