webtorrent-desktop icon indicating copy to clipboard operation
webtorrent-desktop copied to clipboard

why it uses too much memory?

Open sandriaas opened this issue 4 years ago • 10 comments

What version of WebTorrent Desktop are you using? v0.21.0 What operating system and version? Windows 10 v2004 What happened? it uses too much ram, 4GB? that's crazy. only 1 file downloading, 2.3GB Taskmgr_lBPvMJjVUX

sandriaas avatar Mar 22 '20 13:03 sandriaas

hi, in ubuntu 18.04 the same thing, although it eats less than about 2 GB, I’ll add a screen later!

And now screenshot, file download 4.7 gb, and webtorrent use 2.8 gb memory! ______

By the way, this is not one problem, you cannot change the player on this version, fix it, but I have to roll back to the previous one!

Iseg avatar Mar 28 '20 15:03 Iseg

Keep in mind that all the code (javascript is interpreted language, idk about NodeJS), file buffers for downloading and uploading, and media player must be stored somewhere. This is disadventage of "modern" programming languages like Java, JavaScript and Python (which is less RAM heavy, but more CPU intensive).

raspher avatar Jul 17 '20 10:07 raspher

Is this causing noticeable problems?

dsernst avatar Oct 10 '20 08:10 dsernst

I'm also having this problem, I was downloading a 3gb ISO memory usage went to 8gb

jadsongmatos avatar Oct 25 '20 03:10 jadsongmatos

This isn't ideal. Does the memory utilization return to zero when you remove all torrents from the app?

If yes, then it means that WebTorrent is storing file data in memory instead of in the temp folder on the filesystem, which is a bug. If no, then perhaps a memory leak was introduced?

feross avatar Oct 27 '20 04:10 feross

With me it happened during download the memory problem, when I finish the download it returned to normal

jadsongmatos avatar Oct 27 '20 10:10 jadsongmatos

Just wanted to bump this thread, I'm downloading only a Ubuntu ISO and my RAM is being demolished - it's currently using 16GB of RAM while it download a file that's 2.9GB

2021-03-25 15_51_07-Task Manager

NessDan avatar Mar 25 '21 19:03 NessDan

Just wanted to bump this thread, I'm downloading only a Ubuntu ISO and my RAM is being demolished - it's currently using 16GB of RAM while it download a file that's 2.9GB

2021-03-25 15_51_07-Task Manager

this is because the store isn't keeping up with your download speeds, you're downloading at 5200 Mbit/s which are speeds that no SSDs can currently achieve without RAID, from what I know store backpressure is in the works, just as speed cap, which help with these, also there's currently an issue where partial pieces are kept in RAM https://github.com/webtorrent/webtorrent/issues/1973

if you need this fixed NOW, I recommend you re-compile webtorrent-desktop with https://github.com/webtorrent/webtorrent/pull/2000

ThaUnknown avatar Mar 25 '21 20:03 ThaUnknown

this is because the store isn't keeping up with your download speeds, you're downloading at 5200 Mbit/s which are speeds that no SSDs can currently achieve without RAID, from what I know store backpressure is in the works, just as speed cap, which help with these, also there's currently an issue where partial pieces are kept in RAM webtorrent/webtorrent#1973

if you need this fixed NOW, I recommend you re-compile webtorrent-desktop with webtorrent/webtorrent#2000

Appreciate the response! I think there's an issue here then, my internet speed is definitely not that fast (WebTorrent said "643MB/s" almost the entire time, despite me actually only getting ~1.4Mbps (see the Task Manager)

I wish I got those kind of speeds 😂 But my peak speed was about ~300mbps (37MB/s)

So it seems maybe WebTorrent thinks it's receiving way more data than it is, thus pushing it into RAM?

NessDan avatar Mar 26 '21 04:03 NessDan

I’m also affected by the similar issue on macOS when leaving WebTorrent open for a few hours or days. Note that this causes a noticeable system performance degradation. Restarting WebTorrent app seems to fix the issue (until it gradually leaks more memory than the system has).

webtorrent-memory-usage

tie avatar Oct 22 '21 12:10 tie

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

github-actions[bot] avatar Sep 05 '22 12:09 github-actions[bot]