feedindicator / Feedindicator

RSS feed updates in Ubuntu, as a lightweight indicator
38 stars 12 forks source link

huge memory leak #20

Open nicolas-raoul opened 9 years ago

nicolas-raoul commented 9 years ago

Originally reported on Google Code with ID 10

im experiencing a huge memory leak on ubuntu maverick 64 bit. last night it was using
over 1.5 gigs, after 2 hours of uptime today its already using 300mb. im not sure what
more info i can provide, if u tell me how ill post more info

Reported by exleper on 2011-02-08 12:12:31

nicolas-raoul commented 9 years ago
Hi there, thanks for the report. There's definitely some work to be done on cleaning
up the memory usage although that seems pretty huge.

How many feeds do you have in the list? Also if you could post which feeds they are,
that may help.

At the moment I believe it's keeping in each entire feed in memory, when it only really
needs to remember the titles and url's.

Reported by clickopen on 2011-02-08 15:12:36

nicolas-raoul commented 9 years ago
hi
just one perfectly normal feed, however i set it to update every 2 minutes. been using
the same feed and same update interval in yarssr with no issues. the feed is http://www.tottenhamhotspur.com/rss/tottenham_hotspur_news.xml

ive noticed the mem usage seems to increase by about 0.5mb each time it updates, this
can be tested by manually clicking 'reload all feeds'

Reported by exleper on 2011-02-08 16:51:29

nicolas-raoul commented 9 years ago
Hi, 
i have the same problem with the memory. I also use ubuntu maverick 64 bit with 3gb
ram. There are 3 feeds in the list and after about an hour uptime itś using 500mb !!

Reported by tobilalas@freenet.de on 2011-02-08 19:33:34

nicolas-raoul commented 9 years ago
I've done some cleaning up of the memory usage, including only remembering the feed
data that is used (title + url) rather than the entire content of each parsed feed.

However I don't think it's totally fixed yet. Seems that memory still increases after
each update. Kinda weird that it jumps up by such a big amount.

If anyone can see what's causing it do let me know.

Reported by clickopen on 2011-02-09 00:35:33

nicolas-raoul commented 9 years ago
I have a simular project that I started a few month ago, it parses news and pm's from
a certain news website.
I too am experiencing memory leaks simular to you, and I think the problem is the app
indicator, because I have a version with normal indicators, and it doesn't have this
problem.

Just thought to let you know :)

Reported by jimbauwens on 2011-02-09 10:26:56

nicolas-raoul commented 9 years ago
Interesting, thanks for letting me know about that. I have a suspicion is has something
to do with creating the menu, which is done each time the feeds are updated, or marked
as read/unread in this app, rather than any variable lists or dictionaries increasing
in size over time.

Reported by clickopen on 2011-02-09 20:37:11

nicolas-raoul commented 9 years ago
So it certainly seems to be menu-generating related. I commented out the set_menu function
(as below) which is the appindicator function that renders the gtk.Menu() passed to
it. After a brief test running in the terminal with this line commented out, it seemed
to stay steady in memory usage and not increase after several feed updates.

Comment out: (you won't see the indicator or any menu, of course)
# self.ind.set_menu(self.menu)

So it looks like it's an appindicator bug - Seems there are some reports of other indicators
consuming more and more memory too.. Hmm

Reported by clickopen on 2011-02-10 07:46:55

nicolas-raoul commented 9 years ago
I tried many different things, just so that it would release the memory, but nothing
works.
Maybe we should file a bug report on python-appindicator (or whatever)?

I'll try to make a demo that demonstrates the leak.

Jim

Reported by jimbauwens on 2011-02-11 08:55:30

nicolas-raoul commented 9 years ago
Ok, created a demo (see attached file)
It updates the menu every 2 seconds, and you can see the memory go up like a rocket.

Reported by jimbauwens on 2011-02-11 09:27:06


nicolas-raoul commented 9 years ago
Thanks for the test script, works nicely. I've filed a bug report on Launchpad:
https://bugs.launchpad.net/ubuntu/+source/indicator-application/+bug/717529

Reported by clickopen on 2011-02-12 02:21:40

nicolas-raoul commented 9 years ago
Lets hope they find the problem, as it makes app indicators in python unusable.
I'm going to download the source of pyton-appindicator and try debugging it myself.

Reported by jimbauwens on 2011-02-12 20:42:53

nicolas-raoul commented 9 years ago
huge memory use after opening large number of feeds. 10 feeds on the list set to update
every 60 minutes. one feed yields around 20 new items around midday - after opening
them in browser, memory usage shoots up to ~500mb from 20-25mb. fix/workaround?

Reported by nikhilpjoseph on 2011-03-30 13:02:45

nicolas-raoul commented 9 years ago
Hey I'm on Ubuntu 10.10 x64 and python hits sometimes over 2 GB ram when feedindicator
is running for several hours. I have 16 feeds, updates every half hour. Normal feeds
like omgUbuntu and /.

Reported by einrad.traum on 2011-04-07 09:16:55

nicolas-raoul commented 9 years ago
The problem is with python-indicator, and the developers don't seem to take interest
in this bug :(

Reported by jimbauwens on 2011-04-07 09:23:08

nicolas-raoul commented 9 years ago
Unfortunately, there's not a lot I can do about this one folks. I've tested my code
when taking out the render menu part, and there's no memory problem, and Jim's sample
script demonstrates it's the appindicator module.

Hopefully someone will get it fixed, please add yourself to the bug report on Launchpad:
https://bugs.launchpad.net/ubuntu/+source/indicator-application/+bug/717529

Reported by clickopen on 2011-04-08 03:01:16

nicolas-raoul commented 9 years ago
i dont know about u guys, but the problems seem to be completely gone in natty, seems
to stay steady at about 15mb

Reported by exleper on 2011-05-02 16:26:21

nicolas-raoul commented 9 years ago
Yes, the bug has been fixed in Natty, however it is still present in Maverick, and I
don't think its going to be fixed.

Anyway, Natty user can rejoice, as they will not have this problem anymore.

Reported by jimbauwens on 2011-05-03 11:21:08

nicolas-raoul commented 9 years ago
Marking this a done. Unfortunately there's not much I can do about the pre-Natty problems.

However, it runs ok for me on Lucid 10.04 with four feeds updating every 30 minutes,
the memory usage over a day doesn't increase by enough to cause much of a problem.

Reported by clickopen on 2011-05-03 17:50:58

nicolas-raoul commented 9 years ago
Issue 26 has been merged into this issue.

Reported by clickopen on 2011-06-20 16:02:36