Bug 493425 - Plasma hangs while copying items for a length of time proportional to the size of the clipboard history
Summary: Plasma hangs while copying items for a length of time proportional to the siz...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (show other bugs)
Version: 6.1.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-21 10:30 UTC by JadenJSJ
Modified: 2025-01-06 15:33 UTC (History)
5 users (show)

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


Attachments
Big clipboard history file size (84.58 KB, image/png)
2024-09-29 12:11 UTC, JadenJSJ
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JadenJSJ 2024-09-21 10:30:33 UTC
SUMMARY
Plasma KDE freezes when copying items to clipboard & opening clipboard manager Win+V
(everything, such as: taskbar, startmenu, and brightness/volume screen overlay)

STEPS TO REPRODUCE
1. Configure klipper to have a History size of 2048 entries
2. Copy lots of items such as text and images (typical use) over time
....After lots of use....
3. Take a screenshot, then copy text, Open clipboard manager. (Win+V, or taskbar)
One of these actions will trigger a freeze

OBSERVED RESULT
Over time when lots of entries have been accumulated,
plasma becomes unresponsive after copying text and especially images.
Opening clipboard manager can take over 40s. 

EXPECTED RESULT
Doesn't freeze on copy when there is a large clipboard history.
Searching through a unlimited or a very long history clipboard is very helpful to my workflow.

SOFTWARE/OS VERSIONS (kinfo)
Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-7200U CPU @ 2.50GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620

ADDITIONAL INFORMATION
The screen capture program used is Flameshot & Spectacle (Happens in both)
Bug posted on general product because "Sorry, entering a bug into the product klipper has been disabled."
Comment 1 Akseli Lahtinen 2024-09-24 09:25:27 UTC
Hi, can you report your memory usage here when the clipboard reaches this point?

You can type "free -m" to terminal and copy the information in here.

Thanks!
Comment 2 JadenJSJ 2024-09-25 02:14:11 UTC
(In reply to Akseli Lahtinen from comment #1)
> Hi, can you report your memory usage here when the clipboard reaches this
> point?
> 
> You can type "free -m" to terminal and copy the information in here.
> 
> Thanks!

Sure, here is the output of free -m while waiting for the clipboard manager to open
# While opening clipboard manager right after copying
sudo free -m
               total        used        free      shared  buff/cache   available
Mem:            7791        5609         411         892        2945        2182
Swap:          10039        1092        8947

sudo free -m
               total        used        free      shared  buff/cache   available
Mem:            7791        5601         410         892        2955        2190
Swap:          10039        1092        8947

sudo free -m
               total        used        free      shared  buff/cache   available
Mem:            7791        5550         449         886        2960        2241
Swap:          10039        1092        8947

# After Finished Opening
sudo free -m
               total        used        free      shared  buff/cache   available
Mem:            7791        5481         409         878        3061        2310
Swap:          10039        1089        8949

sudo free -m
               total        used        free      shared  buff/cache   available
Mem:            7791        5485         399         878        3068        2306
Swap:          10039        1089        8949

I did it twice to make sure there were no anomalies
Comment 3 JadenJSJ 2024-09-25 02:17:05 UTC
Now sure how this would affect the reading of 
sudo free -m

But I have zram setup
```
$ zramctl --output-all
NAME       DISKSIZE DATA COMPR ALGORITHM STREAMS ZERO-PAGES  TOTAL MEM-LIMIT MEM-USED MIGRATED MOUNTPOINT
/dev/zram0     3.8G   1G  188M zstd            4      32329 200.7M        0B   439.1M    46.5K [SWAP]
```
Comment 4 JadenJSJ 2024-09-29 12:11:21 UTC
Created attachment 174200 [details]
Big clipboard history file size

Wow I just checked the file in ~/.local/share/klipper/history2.lst
And it was 107MB

The one that I copied over before reinstalling my system with Plasma 6 was only 4.2MB

Also turns out yes plasmashell uses 100% cpu of one core when pasting something (with a big history)
And the memory usage does increase (but its not a memory problem) (please note I have ZRAM as swap, nothing is actually being written to the actual disk swap)
Comment 5 Bug Janitor Service 2024-10-14 03:47:34 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2024-10-29 03:46:51 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.
Comment 7 JadenJSJ 2024-11-03 12:11:41 UTC
Looks like this also happens with a smaller clipboard size.
I now have set it to 256 entries and I still have those issues, but the length it freezes is just shorter, maybe a good 3-4s
Comment 8 Hegyi László 2024-11-15 12:03:59 UTC
Hi
I think this is same as https://bugs.kde.org/show_bug.cgi?id=487395. Do you have a lot of pictures in your history?
I think Klipper encodes them every time the clipboard history changes
Comment 9 Fushan Wen 2025-01-06 15:33:14 UTC
The performance has been improved in 6.3. Marking as resolved...