rnote
rnote copied to clipboard
High memory usage
Describe the bug
In some documents (with a lot of written text and images), memory usage jumps to multiple gigabytes when panning and zooming out aggressively.
To Reproduce
I don't really know which things in the document are causing the issue, but I can provide a document that triggers the issue (it's some notes I took while studying for an exam, shouldn't contain anything sensitive).
Steps to reproduce the behavior:
- Open the provided file
- Zoom in and start panning the window
- Zoom out as far as you can
- Repeat until memory usage increases to multiple gigabytes. It may take a little while to reproduce (a few minutes at most), but after a seemingly random amount of time, memory usage instantly jumps from around 1.5GB to 4GB.
Expected behavior
I expected memory usage to be much lower.
Console Output
Nothing besides the initial log message: DEBUG rnote::app::imp > ... env_logger initialized.
Desktop:
- OS: Fedora Linux
- Version: 37
- Installation source: Flatpak (Rnote 0.5.12)
- Desktop Environment: GNOME 43.2
Additional context
I don't know what exactly causes it. Maybe some tools can be used to figure out what's consuming so much memory?
I can reproduce this sometimes like you described. I don't have a solution yet, it needs a more detailed look into it. There are also plans to swap out cairo wiht a GPU-based renderer eventually (vello, maybe) that should make it possible to reduce memory usage while keeping performance high.
Is there any progress on this? I have a certain type of PDF which always cause huge memory usage (~10-15 GB) even though the PDF itself is like ~10 MB and nothing is done besides importing. It always happens with the PDFs I receive from the same person, so I guess something about the way they / their software exports these PDFs causes this. It also drastically reduces performance to the point where the CPU is pinned to 100%, and I have to wait for a minute for just a single page of the PDF displaying, and they always immediately get unloaded when scrolling, so usability is practically 0. Regular PDF viewers or say Xournal++ don't have the same issues with these PDFs.
Can you share the Pdf that causes this?
I can share some but ideally privately. Can I send you access via a Mastodon DM?
Is it not possible to generate a file that reproduces this and doesn't have sensitive information on it? Then it might be easier in the case where it is an issue with the underlying image simplification library/rendering library. But if not sharing it privately is also fine
I don't know how this file is generated but it's not specifically sensitive. Just a question of privacy :)
Here is a file that makes Rnote go up to 3.5GB of ram for me: Übungen-S103-104.pdf, this is a rather mild example but it's all I can find right now that doesn't have sensitive information in it, I have other files that exceed it to the point of Rnote being killed for using too much. I think the issue is with PDF files that have raster images in them, especially document scans made with android apps such as Microsoft Lens.