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

Memory leak suspicions after leaving https://webtorrent.io/ opened during many hours #1591

Closed
tuxayo opened this issue Mar 8, 2019 · 8 comments
Closed
Labels

Comments

@tuxayo
Copy link

@tuxayo tuxayo commented Mar 8, 2019

What version of WebTorrent?

All those on https://webtorrent.io/ since few months. (since I'm using it)

What browser and version? (if using WebTorrent in the browser)
Firefox Developer Edition 66.0b11 (64-bit) on Linux
Since few months I'm seeing this previous versions of Firefox also.

What did you expect to happen?

To be able to "seed" the project's homepage demo during a lot of time without issue.

What actually happened?

Didn't pay attention to the used RAM this time => 10 min freeze until OOM killer killed the process of the tab running WebTorrent.
According to the free RAM&swap after the issue, when I reopened WebTorrent and waited for the demo to download again, the difference was more than 3GiB of RAM.
Although that seem too high compared to the previous measures [1] and the time I left WebTorrent opened.

[1] when I closed WebTorrent before having an OOM.

  • 1830 MiB on time
  • 500 MiB another time

I'll add more precises measures over time.

@tuxayo

This comment has been minimized.

Copy link
Author

@tuxayo tuxayo commented Mar 18, 2019

Test in progress with Chromium Version 72.0.3626.121 Ubuntu 18.04 (64-bit)

Beginning after downloading.
komenco

After 5h hours

post-5h

After few days (laptop suspended at night):
I saw 800MB 20 min ago, and by the time I wrote this it went to 516MB

I'll tell the real usage if I really need RAM and need to close the tab.

@jimmywarting

This comment has been minimized.

Copy link
Contributor

@jimmywarting jimmywarting commented Mar 18, 2019

A tip when testing use a new window instead of a new tab (since background tabs can be somewhat idle sometimes)

@tuxayo

This comment has been minimized.

Copy link
Author

@tuxayo tuxayo commented Mar 28, 2019

Thanks, indeed I always use foreground tabs.
The first experiment lasted 10 days, since few days it was at ~520MB constantly.
Unfortunately, my computer crashed for another reason so I could not close the page, open it, wait from download to finish, and check the RAM usage difference at a system level.

So I'm retrying again :)

@guanzo

This comment has been minimized.

Copy link
Contributor

@guanzo guanzo commented Mar 28, 2019

@tuxayo Any errors in the console? I'm guessing the memory leak is related to Chrome not garbage collecting RTCPeerConnection objects. feross/simple-peer#422. That's what I see after leaving a tab open for many hours.

@tuxayo

This comment has been minimized.

Copy link
Author

@tuxayo tuxayo commented Apr 2, 2019

additional results:
815MB of RAM used according to the Chromium task manager

  • closes the tab
  • opened the page in a new tab
  • wait from download to finish
  • check the RAM usage difference at a system level
    result: 712MB of RAM used
@tuxayo

This comment has been minimized.

Copy link
Author

@tuxayo tuxayo commented Apr 2, 2019

Any errors in the console? I'm guessing the memory leak is related to Chrome not garbage collecting RTCPeerConnection objects. feross/simple-peer#422. That's what I see after leaving a tab open for many hours.

Indeed! here is my log:
webtorrent-console-log.txt

I'll retry with Firefox where I initially started suspecting this memory issue.

@tuxayo

This comment has been minimized.

Copy link
Author

@tuxayo tuxayo commented Apr 4, 2019

I just measured on Firefox (v67b7) a 2310MB RAM difference when closing the webtorrent tab, opening a new one, waiting for the end of the download.

So this is what I was having since few months, the previous huge findings were not errors.
(this shows that's is not related to one version of my Firefox)

The page was left open for more than 36h.
I'll retry with shorter times and edit this message.

logs:
console-logs.txt
(seems nothing interesting except many ICE errors)

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Jul 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jul 3, 2019
@stale stale bot closed this Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

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