mirror of https://github.com/webpack/webpack.git
avoid memory leak in v8 ICs after parsing and building modules
This commit is contained in:
parent
2696446edf
commit
87b67a920d
|
|
@ -749,6 +749,9 @@ class NormalModule extends Module {
|
|||
}
|
||||
},
|
||||
(err, result) => {
|
||||
// Cleanup loaderContext to avoid leaking memory in ICs
|
||||
loaderContext._compilation = loaderContext._compiler = loaderContext._module = loaderContext.fs = undefined;
|
||||
|
||||
if (!result) {
|
||||
return processResult(
|
||||
err || new Error("No result from loader-runner processing"),
|
||||
|
|
|
|||
|
|
@ -942,6 +942,10 @@ class JavascriptParser extends Parser {
|
|||
.setRange(expr.range);
|
||||
}
|
||||
});
|
||||
this.hooks.finish.tap("JavascriptParser", () => {
|
||||
// Cleanup for GC
|
||||
cachedExpression = cachedInfo = undefined;
|
||||
});
|
||||
};
|
||||
tapEvaluateWithVariableInfo("Identifier", expr => {
|
||||
const info = this.getVariableInfo(
|
||||
|
|
|
|||
Loading…
Reference in New Issue