-
-
Notifications
You must be signed in to change notification settings - Fork 433
Memory leak on watcher dispose #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Which version are you using? Does this apply to the latest version? If you could spend some time on this it would be greatly appreciated! |
Of, forgot to say... silly me xD I guess they are the latest. Just made Also, if someone can copypaste the script and confirm that this happens to him also, would be nice. |
If someone else can take a look at this (btw not totally sure this is an issue or not yet) that'd be awesome. If not I'll probably close this issue; I don't have time to look into it myself and I'm not experiencing the issue described |
Perhaps related to #421 |
If you add in the loader options plugin as suggested in #421 does this resolve the issue? |
As far as I can remember, I had one plugin defining a production environment variable, but I removed it from the script above. This evening I'll check/try it. |
thanks |
Ok, I was not using Upgraded to var i = 0;
var path = require("path");
var webpack = require("webpack");
function c() {
var compiler = webpack({
context: path.join(__dirname),
entry: "./main3.ts",
output: {
filename: 'bundle.js',
path: '/'
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
loaders: [
{
test: /\.tsx?$/,
loader: "ts-loader"
}
]
},
plugins: [
new webpack.LoaderOptionsPlugin({ options: {} })
]
});
compiler.plugin("compile", function () {
console.log("cmp", i++);
});
return compiler.watch({
aggregateTimeout: 333
}, (err, stats) => {
setTimeout(() => {
oldc.close();
oldc = c();
}, 33);
});
}
oldc = c(); The The
Received the same error after some minutes (
In short, these are my versions:
|
And if you add the loader options plugin does it resolve the issue? |
Like this:
|
I'm not sure where to add it. In the code above it is added inside the Now I changed it to plugins: [
new webpack.LoaderOptionsPlugin({
options: {
resolve: {
extensions: ['.ts', '.tsx', '.js', 'jsx']
}
}
})
] And still having the problem. |
Very strange. Thanks for trying. Could you try using ts-loader 1.3.1 and see if it's still an issue? |
And still receiving the problem at You said you don't have this problem when copypasting the script? Could this be a TypeScript version problem then? Or a dependant module? (I had EDIT: Well, we can say that |
I haven't used your script. I've been running ts-loader in watch mode for days at a time and watching the memory. It stays pretty static. In normal usage there's no sign that I've picked up on of a memory leak. Which is good. But confusing |
Oh, the thing is that I'm closing the watcher and opening a new one on each loop (Was the main reason of this test). Watcher could be fine. The problem can be when disposing it. |
That's interesting. Since watch mode only typically ends when the process terminated and all resources seem to be released then that means I'm a little less concerned. Still like to get to the bottom of this though |
Let's see if someone (or me when I get forced to use |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing as stale. Please reopen if you'd like to work on this further. |
When I run this code:
Having as
main3.ts
contents simply a bunch ofconsole.log
(about 10k, for testing), without any dependencies of anything, after some time I get a "process out of memory" error.Don't happens if I change the
main3.ts
extension tojs
(so the loader is not used) and also don't happens withawesome-typescript-loader
(you see the memory going up and down, instead of all the way up), so I guess is ats-loader
problem.The text was updated successfully, but these errors were encountered: