Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upshould remove part of memory leaks #382
Conversation
33fd010
to
c1cecc2
5b07d88
to
c2e6dc7
632436f
to
44e486b
This comment has been minimized.
This comment has been minimized.
|
also |
This comment has been minimized.
This comment has been minimized.
|
I think it would be interesting to have some way to measure how much the memory leaks decreased. |
This comment has been minimized.
This comment has been minimized.
|
You can use this trick. Add this in every file and Class (instances of which could be destroyed) in every webtorrent module. var MemoryLeak = function(){}
Item.die = function() {
// ...
this.leak = new MemoryLeak()
// ...
}I guess it can be added in master branch with var isDebugging = process.NODE_ENV == 'DEBUG';
//...
Item.die = function() {
// ...
if (isDebugging) {
this.leak = new MemoryLeak()
}
// ...
}(If your code has no leaks than GC will remove whole |
This comment has been minimized.
This comment has been minimized.
|
Well, I've put Started webtorrent-desktop (whithout code in commit) download and got some leaksClick start/stop and got more leaksSo looks like this commit 44e486b is not enough I guess that this code is also problem: |
…teners in foreight objects



arestov commentedJul 19, 2015
memory leaks through closures of callback in event listeners in foreight objects.
destroyshould unsubscribe current object from any events in foreight objects