GNOME Bugzilla – Bug 106598
Epiphany consumes all the memory when importing galeon bookmarks
Last modified: 2004-12-22 21:47:04 UTC
I have, according to grep -c '<bookmark' ~/.galeon/bookmarks.xbel, 808 bookmakrs in Galeon. When importing them into Epiphany, it will start chewing up all the available memory until the OOM killer kicks in. $ epiphany --version Gnome epiphany-browser 0.5.0 $ dpkg -s epiphany-browser | grep ^Version: Version: 0.5.0+0.4.99.20030214-4 Thanks, Marcelo
For me to debug this, I think I'll need a copy of your bookmarks file. If you don't want to attach it with the real content in it, I'm attaching a little python script to strip that stuff out. Just save it as 'strip.py' or something, and do './strip.py ~/.galeon/bookmarks.xbel'. It will save the stripped version as 'stripped_bookmarks.xbel'. Thanks a lot.
Created attachment 14532 [details] The python script. BTW, you need the libxml2 python stuff for this to work
Created attachment 14543 [details] Requested file, bug still reproduceable
*** Bug 111866 has been marked as a duplicate of this bug. ***
The same problem applies to importing Mozilla bookmarks as well. 841 in my case, Epiphany makes the system run out of memory before it gets through with the job.
The problem was a missing xmlFreeDoc() call in the end of ephy_bookmarks_save(). Adding this makes the import memory usage stable, but it still takes a very long time due to the bookmarks file being rewritten after each imported bookmark. I'm attaching a diff that changes this as well - bookmarks are saved only once after the import is done, which makes the import fast enough to be virtually instantaneous.
Created attachment 16241 [details] [review] Fix for memory leak and cpu hogging of bookmark import
Rocking, you found the prob :) We still need to save when adding single bookmarks though, need to think to a sane way to do it, anyway you did the hard part, thanks !
That's taken care of by the patch already. The only place that I found that called ephy_bookmarks_add() will call ephy_bookmarks_save() immediately afterwards. The alternative would have been to add a boolean save parameter and/or a second function, but this made for a smaller patch.
Oh missed that bit. Yeah it sounds like a good solution. I'll commit it (it would be good if you could add a ChangeLog). Or if you have cvs access please commit it.
Created attachment 16278 [details] [review] updated patch, with ChangeLog
I don't have CVS access..
Committed, thanks !