Description
Hey guys,
We use webpack in our services to bundle code.
A webpack compiler is being created for each bundling process by importing webpack
creator function from webpack
.
Webpack is using enhanced-resolve to resolve module paths.. We also have custom resolvers that extends ResolvePluginInstance
which is a enhanced-resolve
resolver AFAIK.
Those resolvers are injected to webpack using the plugins
property
After a while, we saw that as the service bundle code a memory leak is increasing in our service.
(for each bundle a new compiler of webpack is created)
As you can see in the heap-dump picture, it is related to joinCache
property.
This property can be found here. this is a non-exported global variable that never cleans.
As I can see it, you can help us in 2 ways,
- Clean this Map every X interval (it will be amazing if you can provide a configuration for it)
- Provide a function that cleans that cache and we will call it after every bundle process.
LMK if you need any further data/explanations,
Thanks 🙏🏼🙏🏼