WebTorrent should not store torrent data in memory
See original GitHub issueDescription
WebTorrent seems to be keeping the entire torrent in memory as the file is downloaded. I can see the RAM usage of the “Brave Browser Helper” process increase along with the amount of the torrent that is downloaded, which should not happen. It appears that it is being initialized with the in-memory storage mode instead of the filesystem mode. This is because webpack is used to build the JS for the WebTorrent extension and that causes WebTorrent to substitute certain packages using the package.json
“browser” field.
May be related to: https://github.com/brave/brave-browser/issues/5372
Steps to Reproduce
- Visit http://mirror.math.princeton.edu/pub/mageia/iso/7.1/torrents/Mageia-7.1-x86_64.torrent
- Start the torrent download
- Open
Activity Monitor.app
on Mac and observe memory usage climbing in proportion to the amount of torrent that is downloaded.
Actual result:
Torrent is stored in memory instead of on the disk.
Expected result:
Torrent should not consume RAM in proportion to the torrent size, since this means that users with e.g. 8GB RAM are going to have a sad time when they download an 8GB+ torrent.
Reproduces how often:
Easily reproduced
Brave version (brave://version info)
All Chromium versions.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:29 (3 by maintainers)
Top GitHub Comments
Hopefully, in the next few weeks I might be able to take a look, no promise though. This is on my todo list 😄
This should probably be prioritized and fixed soon. Torrent feature becomes useless if the browser starts to freeze up and download is lost.
cc: @rebron @bsclifton @feross