Skip to content
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

concurrency and possible memory leak? #407

Closed
btmdave opened this issue Aug 24, 2015 · 11 comments
Closed

concurrency and possible memory leak? #407

btmdave opened this issue Aug 24, 2015 · 11 comments

Comments

@btmdave
Copy link

@btmdave btmdave commented Aug 24, 2015

When running in node, it seems that there's some memory leaks. I've setup 10 clients to download and it just climes up to 1.7g and cuts off. Even with only a couple simultaneous downloads the memory just slow climes up over time, is this a known issue or are there any stats for running a higher level of concurrency?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 24, 2015

What version of WebTorrent are you using?
On Mon, Aug 24, 2015 at 7:42 PM Dave Squires notifications@github.com
wrote:

When running in node, it seems that there's some memory leaks. I've setup
10 clients to download and it just climes up to 1.7g and cuts off. Even
with only a couple simultaneous downloads the memory just slow climes up
over time, is this a known issue or are there any stats for running a
higher level of concurrency?


Reply to this email directly or view it on GitHub
#407.

@btmdave

This comment has been minimized.

Copy link
Author

@btmdave btmdave commented Aug 24, 2015

0.60.0 with node 0.12.7. Is there maybe a limit on the size of torrent? I saw some issues about buffer limits, not sure if that still holds true.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 24, 2015

Can you share the code that triggers this? I'll take a look.
On Mon, Aug 24, 2015 at 9:09 PM Dave Squires notifications@github.com
wrote:

0.60.0 with node 0.12.7. Is there maybe a limit on the size of torrent? I
saw some issues about buffer limits, not sure if that still holds true.


Reply to this email directly or view it on GitHub
#407 (comment).

@btmdave

This comment has been minimized.

Copy link
Author

@btmdave btmdave commented Aug 24, 2015

Cool thanks, here it is: https://gist.github.com/btmdave/1ea4b14b1754b8d7bffe

It's not actually doing it now for me as it's no longer downloading (re: #408)

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 30, 2015

@btmdave

Can you give it a try with webtorrent 0.57.0? We made significant code changes in 0.58.0 and I'm curious if that may be the cause.

npm install webtorrent@0.57.0
@shavyg2

This comment has been minimized.

Copy link

@shavyg2 shavyg2 commented Sep 13, 2015

kk this version works alot better. I was getting memory of 1,800 MB but now it's under 400mb.
Torrent.pieceLength is missing tho.

@Stiveknx

This comment has been minimized.

Copy link
Contributor

@Stiveknx Stiveknx commented Sep 18, 2015

I'm facing some memory leaks too.
After 0.58.0.

I command line, I'm getting this error:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

I'm trying to find what change is causing this leak, but there's a lot to look for.
Apparently, it's something related to storage.

While playing with webtorrent's code, I commented all logic to verify existing torrent data. Without it, the error got delayed, and with it, the download doesn't even starts (it ran out of memory while checking data).

@antonheryanto

This comment has been minimized.

Copy link

@antonheryanto antonheryanto commented Jan 7, 2016

got similar problem here webtorrent

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

run on webtorrent 0.71.1 node v0.10.36 on nas (low cpu and memory) 128MB
but peerflix running ok

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jan 9, 2016

Running on node 4.x and WebTorrent 0.71.4, I have no memory issues.

RAM usage hovers around 130mb. But it occasionally rises to 200mb before going back down. I think there's a baseline of RAM usage that can't go away because it's all source code that is require'd.

Try using a system with at least 500mb of RAM to avoid issues.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jan 9, 2016

Going to close this issue as I can't think of an easy solution to get RAM usage consistently below 128mb. If someone has any ideas, feel free to leave a comment.

@feross feross closed this Jan 9, 2016
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.