• Loading on demand is fine, but require() loads the code as a module, so all of the module gets cached (in case you use it a second time) and you have to manually clear it with Modules.removeCached(...).

    If you just load it with new Function(..) or eval then when the function is done executing, all the variables referenced by it will get freed.

About

Avatar for Gordon @Gordon started