Bug 500769 - Very high memory usage and lockup of entire system
Summary: Very high memory usage and lockup of entire system
Status: RESOLVED MOVED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (other bugs)
Version First Reported In: 24.12.2
Platform: Flatpak Linux
: NOR major
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-26 12:14 UTC by Henning
Modified: 2025-02-26 22:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
weird embedded text files, there are about 40 of those in the one doc that crashed (5.80 KB, text/plain)
2025-02-26 12:18 UTC, Henning
Details
reversed, to get the latest (2.19 KB, text/plain)
2025-02-26 13:04 UTC, Henning
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Henning 2025-02-26 12:14:26 UTC
I assume this is an Okular bug.

1. I startup my system, Fedora Kinoite 41
2. I open firefox, it loads a lot of tabs. I open dolphin and open 2 PDFs, 11MB and 22MB
3. the desktop locks up and nothing works anymore, not even switching to a different TTY, I need to hard reboot. 

I thought this was a kernel bug but I didnt even upgrade it. I was able to reproduce this when only opening a single 11MB document too.

I rebooted, opened FF, dolphin, but launched Okular Flatpak from Konsole. Then I slowly opened one document, no crash but my fan started spinning a lot. no terminal output or errors.

I opened the second one, so 30MB on disk, no idea how much in RAM.

But I checked and Okular uses 6GB RAM, and took pretty long to settle down from 12% CPU or more.

One of the PDFs: https://doi.org/10.1007/978-0-387-34445-4

Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.1
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.12.15-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Xe Graphics
Comment 1 Henning 2025-02-26 12:18:08 UTC
Created attachment 178891 [details]
weird embedded text files, there are about 40 of those in the one doc that crashed

Okular uses 6,8GB RAM with these 2 documents loaded

Also, the lockup of the desktop happened before the Okular window appeared, I only saw a bouncing Okular icon

One of the PDFs has a bunch of embedded files called "folder.joboptions". Opening them, they seem to just be text files with random content in them.

I can attach one of them.
Comment 2 Sune Vuorela 2025-02-26 12:29:07 UTC
This might be document specific, but without the documents I'm not sure we can do anything about it.

Though it shouldn't be  able to crash the computer.

If you can't share the document publically, you can try throw it at my email at sune@kde.org
Comment 3 Henning 2025-02-26 13:04:21 UTC
Created attachment 178894 [details]
reversed, to get the latest
Comment 4 fanzhuyifan 2025-02-26 16:48:23 UTC
(In reply to Henning from comment #0)
> But I checked and Okular uses 6GB RAM, and took pretty long to settle down
> from 12% CPU or more.
> 
> One of the PDFs: https://doi.org/10.1007/978-0-387-34445-4


Cannot reproduce memory leak when only opening this pdf -- residual mem of okular < 600M.

okular 24.12.2
Operating System: Arch Linux 
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.12.0
Qt Version: 6.9.0
Kernel Version: 6.13.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 13th Gen Intel® Core™ i9-13900H
Memory: 15.2 GiB of RAM
Graphics Processor 1: Mesa Intel® Graphics
Graphics Processor 2: llvmpipe
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Zephyrus G16 GU603VV_GU603VV
System Version: 1.0

When can you reproduce the memory leak? Do you have to open both PDFs?
Can you reproduce the memory leak with a new user account?
Comment 5 Henning 2025-02-26 17:38:46 UTC
I am trying to debug the app, but get a weird gdb issue

https://docs.flatpak.org/en/latest/debugging.html

followed the docs, entered the container and ran 

gdb /app/bin/okular
(gdb) run
"/app/bin/okular": not in executable format: file format not recognized

when passing the file I want to open, it tries to execute that file instead, as it does not want to see Okular as an executable program

-------

when launching okular flatpak now, and opening that file with ctrl+o, it just hangs and does not do anything

other apps start crashing too, I cannot open systemmonitor
Comment 6 Henning 2025-02-26 22:30:06 UTC
Update... now Gwenview crashed too, when opening a gif.

Reboot, Celluloid flatpak crashed too.

Weirdly, GNOME Papers (PDF Viewer) worked well.

I think this IS a kernel 6.13 issue, I will open an issue with Fedora.

On 6.12 is works normally