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

High RAM usage #977

Open
sharpaper opened this issue Jun 3, 2020 · 3 comments
Open

High RAM usage #977

sharpaper opened this issue Jun 3, 2020 · 3 comments
Labels
bug This issue reports a problem that ought to be fixed

Comments

@sharpaper
Copy link

Thank you for working on newsboat.
Unfortunately, the program seems to use a lot of memory right out of the box. On my PC I have 90 feed URLs, only a few of which are really active. The majority has a single-digit count of posts. Only starting the program consumes 722MB of RAM.
Unfortunately this was an issue with newsbeuter too. Is there anything that can be done in this regard to reduce the RAM usage? I would expect for a terminal RSS reader to be consuming a few MB at most, not more than other GUI readers instead :)

Newsboat version (copy the output of newsboat -v or the first line of git show):

$ newsboat -v
newsboat 2.13.0 - https://newsboat.org/
Copyright (C) 2006-2015 Andreas Krennmair
Copyright (C) 2015-2018 Alexander Batischev
Copyright (C) 2006-2017 Newsbeuter contributors
Copyright (C) 2017-2018 Newsboat contributors

Newsboat is free software licensed under the MIT License. (Type `newsboat -vv' to see the full text.)
It bundles JSON for Modern C++ library, licensed under the MIT License: https://github.com/nlohmann/json
It bundles an alphanum algorithm implementation licensed under the MIT license: http://www.davekoelle.com/alphanum.html

newsboat 2.13.0
System: Linux 4.9.0-12-amd64 (x86_64)
Compiler: g++ 8.3.0
ncurses: ncurses 6.1.20181013 (compiled with 6.1)
libcurl: libcurl/7.52.1 GnuTLS/3.5.8 zlib/1.2.8 libidn2/2.0.5 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3 (compiled with 7.64.0)
SQLite: 3.16.2 (compiled with 3.27.2)
libxml2: compiled with 2.9.4

Steps to reproduce the issue:

  1. install newsboat from Debian stable
  2. launch newsboat
  3. (automatic) import of the .newsbeuter/ configuration
@Minoru
Copy link
Member

Minoru commented Jun 3, 2020

There's nothing a user can do about this, sorry. There's been multiple attempts at pinpointing the source of this, and we even squashed some bugs in the process, but the memory usage is still high. We're currently in the process of refactoring and moving to a memory-safe language, perhaps that'll help.

@Minoru Minoru added the bug This issue reports a problem that ought to be fixed label Jun 3, 2020
@sharpaper
Copy link
Author

It doesn't look like a memory leak though, even if the memory does grow steadily over time. Or at least not only a memory leak. The program already starts with 100s of MB of resident memory, and then slowly grows over 1GB. There has to be some kind of data structure that is using all this data.

@Minoru
Copy link
Member

Minoru commented Jun 3, 2020

The most likely cause is the fact that RssFeed keeps RssItems in memory even if the user is not looking at them. There was a suggestion in #887 for all getters on RssFeed and RssItem to fetch stuff anew from the database. This would trade performance for memory consumption.

But there ought to be a leak somewhere as well, because the first reload increases RSS even if it brought no new items (at least that's what happens on my machine).

@Minoru Minoru changed the title High RAM memory usage High RAM usage Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports a problem that ought to be fixed
Projects
None yet
Development

No branches or pull requests

2 participants