cadeyrn / bookmarks-organizer

With the Bookmarks Organizer it's easy to put order in your bookmarks. The Bookmarks Organizer finds no longer working bookmarks, redirects, duplicates and more!
https://addons.mozilla.org/en-US/firefox/addon/bookmarks-organizer/
Mozilla Public License 2.0
187 stars 32 forks source link

huge memory usage with any bookmark edit #209

Closed rezad1393 closed 1 year ago

rezad1393 commented 1 year ago

Describe the bug when this addon is enabled and I try to import bookmarks, then memory usage goes to all the RAM in system and system crashes. when I disable this addon this behavior doesn't happen.

with this addon enabled,any pasting of bookmarks gets very slow and if I paste a lot of bookmark firefox gets very slow and bookmarks get added one bye one slowly.

this from addon usually gives errors in firefox log. js/core/background.js

it seems that this addon monitors all the bookmarks operation and does stuff with it that can lead to crash of firefox.

cadeyrn commented 1 year ago

Hello,

this from addon usually gives errors in firefox log.

what exactly can be read in the log?

rezad1393 commented 1 year ago

Hello,

this from addon usually gives errors in firefox log.

what exactly can be read in the log?

I dont remember. and I disabled this addon so I can use firefox normally. for example I had your addon for duplicate finder. so I disabled this addon: https://github.com/vaeth/bookmarkdupes/

but when I didnt suspect your addon and enabled this addon to remove some dups , the deletion goes very slowly. when I disable your addon the deletion goes very fast.

I dont know if this errors are at all important and I think your addon somehow locks(?) or monitors all bookmark operation and that causes all the delays and memory leak that I saw.

01:50:59.671 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
    initBookmarkCount moz-extension://e726126a-027e-4fce-b539-38713cfbc4a6/js/core/background.js:452
background.js:452:21

maybe for test you can create a firefox profile and copy many bookmarks with a lot of dups in them to it (you can just copy paste). then install both these addons (yours and the other one) and try to remove the bookmarks with the other addon with you addo enabled and see the slow process and see it go fast when your addon is disabled.

cadeyrn commented 1 year ago

@rezad1393 Thank you for the report and sorry for the delay. I did found the cause and will try to mitigate it.

BUZZARDGTA commented 1 year ago

I also noticed that problem, didn't know it was specific to this extension, cuz I have a lot of extensions. My solution when I imported a lot of bookmarks was to always simply do it in a "Private window" to avoid those problems.

BUZZARDGTA commented 1 year ago

oh and btw this is totally not related to BO, but when you import a crazy amount of bookmarks, you can save an absolutely insane time of CPU x Memory load by importing without the favicons (ICON="..." and ICON_URI="..." regex: ( )?ICON(_URI)?=\".*?\") in the bookmark file. I have made a script that delete them and in comparison it's mind blowing. Just clarifying again, this is an issue with Mozilla Firefox and not BO. And I'm talking about 7K import of bookmarks.

before removing favicons: MEMORY: 99% speed: So long that I rage quitted it after removing favicons: Memory: idk but it was fine speed: ~5 seconds

I should just report this issue to FF but too lazy, cuz already opened an issue there for something else and they just never replied.

rezad1393 commented 1 year ago

7k?? noob. lame try 20k.

joking aside I had no idea private window would affect the the firefox bookmark manager window. so if I have a normal window and a private window open and then open the bookmark manager how the hell would firefox know which state to be in.

BUZZARDGTA commented 1 year ago

Well I didn't said it but I where closing all other(s) firefox profiles and windows to only remains the private one. But the question you reminded is curious and, I'll do when I have some time a few tests and let you know the result

PS: 20K x_x

cadeyrn commented 1 year ago

oh and btw this is totally not related to BO, but when you import a crazy amount of bookmarks, you can save an absolutely insane time of CPU x Memory load by importing without the favicons

I believe that importing the bookmarks without favicons can make a difference. But still, there is also a cause in Bookmarks Organizer that can lead to a massive memory increase and thus a Firefox crash.

I had no idea private window would affect the the firefox bookmark manager window.

Not directly. But extensions are disabled by default in private windows and if you didn't change this setting Bookmarks Organizer maybe you won't cause the issue.

rezad1393 commented 1 year ago

Not directly. But extensions are disabled by default in private windows and if you didn't change this setting Bookmarks Organizer won't cause the issue as it's disabled.

that was not my point.

I thought addons were disabled in "firefox main windows" that you browser in and can have private and normal mode and not a special window that is bookmark manager of firefox itself.

that would mean we have a private mode that is not associated with a window that is but with the whole firefox itself. I can have two window of firefox open, on in normal mode and one in private mode and then when I open bookmark manager window (the firefox one, not this addon) which one would it inherit? the last one opened maybe?

cadeyrn commented 1 year ago

@rezad1393 The bookmark manager window has nothing to do with regular vs private windows at all.

BUZZARDGTA commented 1 year ago

So I've been doing a few testings on an isolated profile, copying 1000 bookmarks (right clic on bookmarks bar > paste) takes a while longer (around 10 more seconds) when BO is installed and active.

with BO enabled: 20 seconds

with BO Disabled: 2 seconds

testing record video:

https://github.com/cadeyrn/bookmarks-organizer/assets/62464560/9e774705-36dd-4922-9b82-5348ab95c9e5

rezad1393 commented 1 year ago

So I've been doing a few testings on an isolated profile, copying 1000 bookmarks (right clic on bookmarks bar > paste) takes a while longer (around 10 more seconds) when BO is installed and active.

with BO enabled: 20 seconds

with BO Disabled: 2 seconds

testing record video: BO_test.mp4

no need for that. the dev have acknowledged and fixed the issue it seems.

and next time go on 10k bookmark. 1000 is rookie number :)

BUZZARDGTA commented 1 year ago

no need for that. the dev have acknowledged and fixed the issue it seems.

and next time go on 10k bookmark. 1000 is rookie number :)

I would have wait 9x longer doing so

cadeyrn commented 1 year ago

@rezad1393 and @Illegal-Services Bookmarks Organizer 4.1.0 has been released and it includes a fix for the reported issue.