albert icon indicating copy to clipboard operation
albert copied to clipboard

[copyq] memory leak

Open thiagoa opened this issue 4 years ago • 14 comments

Yesterday I noticed that the Albert process in my machine was taking up 1.1 GB of memory. Then I noticed a correlation with CopyQ, even though Albert takes up a lot of memory by default when it launches. I couldn't find a problem with the Python script, so maybe it has to do with the way Albert manages the entries generated by the plugin.

Environment

Steps to reproduce

  • Set CopyQ entry limit to 50 and fill it up
  • Enable the Python CopyQ plugin
  • Trigger CopyQ in Albert with "cq"
  • Each time you trigger it, it will eat up ~10 MB of memory (at least on my machine)

Expected behaviour

Memory should go down and stabilize, but it doesn't seem so.

thiagoa avatar May 29 '20 14:05 thiagoa

I notice similar behaviour, except each trigger consumes >20 MB.

BarrensZeppelin avatar Sep 02 '20 07:09 BarrensZeppelin

I noticed a correlation with CopyQ

Thank you for not just telling me that you have 1 problem.

Can you please further investigate this issue? Can you trace down the subprocesses the plugin runs. Do they quit properly or do you have a lot of deamons? Since I cant debug this atm it would be cool If you could. Try to comment out some lines in the script, e.g. the item creation such that CopyQ gets triggered but no items created etc.

Most of the plugins I wrote are plain prototypes. Nothing really sophisticated. I wonder if I use subprocess correctly in the plugin.

ManuelSchneid3r avatar Nov 04 '20 15:11 ManuelSchneid3r

I just keep it running in the background, and I haven't touch it for a while, it it the top of the list now.

Screenshot_2021-01-13_01-00-38

c02y avatar Jan 12 '21 17:01 c02y

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 12 '21 17:04 stale[bot]

is this still an issue?

ManuelSchneid3r avatar Apr 12 '21 20:04 ManuelSchneid3r

Yes, I can still reproduce this issue.

The amount of memory consumed after each cq trigger depends on the contents of the clipboard, but the memory usage rises nonetheless.

BarrensZeppelin avatar Apr 13 '21 10:04 BarrensZeppelin

Why is this still open?. Is it not fixed yet?.

Ghibranalj avatar Dec 16 '21 13:12 Ghibranalj

This plugin has no maintainer atm. It is pretty small so if you are interested you could try to fix the issue.

ManuelSchneid3r avatar Dec 16 '21 14:12 ManuelSchneid3r

I'll have a look at it and see if i can do something about it.

Ghibranalj avatar Dec 19 '21 16:12 Ghibranalj

Facing the same issue on xubuntu.

voidCounter avatar Mar 08 '22 17:03 voidCounter

@thiagoa @bergercookie does rofi/ulauncher have a copyq extension?

ManuelSchneid3r avatar Mar 09 '22 19:03 ManuelSchneid3r

@ManuelSchneid3r I'm not sure. I'm using https://extensions.gnome.org/extension/779/clipboard-indicator/

Not perfect but it does the job.

thiagoa avatar Mar 09 '22 19:03 thiagoa

I just wondered why you blame Albert as a whole, just because the copyq extension is buggy.

ManuelSchneid3r avatar Mar 09 '22 19:03 ManuelSchneid3r

@ManuelSchneid3r I'm not blaming Albert at all. At the time I investigated this, I recall quickly inspecting the Python code and not finding any memory leaks. I may have been wrong though, so I opened this ticket for investigation. In other words, I'm not really sure where the problem is. Also, I really appreciate that Albert is a nice option and it was really useful to me in the past. Thank you for all the hard work you put into this project, not an easy feat.

thiagoa avatar Mar 09 '22 19:03 thiagoa