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 memory usage #459

Open
Danacus opened this issue Jan 20, 2023 · 8 comments
Open

High memory usage #459

Danacus opened this issue Jan 20, 2023 · 8 comments
Labels
performance Related to app performance

Comments

@Danacus
Copy link
Contributor

Danacus commented Jan 20, 2023

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).

dss.zip

Steps to reproduce the behavior:

  1. Open the provided file
  2. Zoom in and start panning the window
  3. Zoom out as far as you can
  4. 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?

@flxzt flxzt added the performance Related to app performance label Jan 20, 2023
@flxzt
Copy link
Owner

flxzt commented Jan 22, 2023

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.

@RayJW
Copy link
Contributor

RayJW commented Dec 1, 2023

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.

@flxzt
Copy link
Owner

flxzt commented Dec 3, 2023

Can you share the Pdf that causes this?

@RayJW
Copy link
Contributor

RayJW commented Dec 3, 2023

I can share some but ideally privately. Can I send you access via a Mastodon DM?

@flxzt
Copy link
Owner

flxzt commented Dec 3, 2023

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

@RayJW
Copy link
Contributor

RayJW commented Dec 3, 2023

I don't know how this file is generated but it's not specifically sensitive. Just a question of privacy :)

@fruityloops1
Copy link

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.

@Doublonmousse
Copy link
Collaborator

There seems to be cases where using resvg (that calls to usvg) to render some svg will result in large memory consumption (linebender/resvg#852). It's probable we see some of it even if the rendering part isn't the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Related to app performance
Projects
None yet
Development

No branches or pull requests

5 participants