While analyzing excessive memory usage in an AEM 6.4 instance I discovered a memory leak transitively introduced via the SlyBindingsValues Provider.
Here, the SlyBindingsValuesProvider creates these factory function instances by executing the factory scripts using, amongst others, the current ENGINE-scoped script bindings.
Thus, a chain of strong references is formed to request-scoped instances. This keeps open dozens to potentially thousands of request-scoped Objects such as Sling Models, requests, resources, resource resolvers and their respective transitive hull, resulting in significant memory consumption.
I have attached an excerpt of the respective view on the Heap generated using JProfiler. Note that the issue is not specific to the aem.js mentioned therein, but is generally caused by any of the factory scripts.