felixge / node-sandboxed-module

A sandboxed node.js module loader that lets you inject dependencies into your modules.
MIT License
342 stars 42 forks source link

Deleting modules #71

Open srolel opened 3 years ago

srolel commented 3 years ago

Hi, first of all this package works great!

I have a use-case where I want to load sandboxed modules on demand but would like to be able to clean up after them as well, i.e. removing them from memory as much as possible. Any ideas on how I could do that?

Update: after looking at the memory snapshot, looks like the code (as a string) stays in memory forever.