Closed Bug 344983 Opened 18 years ago Closed 18 years ago

Firefox leaks every nsIFeedResult created as a result of visiting feed pages

Categories

(Firefox Graveyard :: RSS Discovery and Preview, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 2 beta2

People

(Reporter: Waldo, Assigned: sayrer)

References

()

Details

(Keywords: fixed1.8.1, memory-leak)

Attachments

(4 files, 2 obsolete files)

Feed result objects are created and added to the feed result service when feeds are visited, but they're never removed.  Consequently, whatever's in those objects will stay around until shutdown.
To be fixed after bug 344651 and bug 340677...
Status: NEW → ASSIGNED
Flags: blocking-firefox2?
Whiteboard: [swag: 1d or less]
Flags: blocking-firefox2? → blocking-firefox2+
Target Milestone: --- → Firefox 2 beta2
waldo, could you verify that the patch fixes the leak?
OK, this doesn't leak in my tests
Attachment #231707 - Attachment is obsolete: true
Attachment #231757 - Flags: review?(bugs)
had an extra file in the previous patch
Attachment #231757 - Attachment is obsolete: true
Attachment #231758 - Flags: review?(bugs)
Attachment #231757 - Flags: review?(bugs)
Assignee: jwalden+bmo → sayrer
Status: ASSIGNED → NEW
Whiteboard: [swag: 1d or less]
Whiteboard: [has patch][needs review ben]
(In reply to comment #3)
> waldo, could you verify that the patch fixes the leak?

I'll try to do this, but I don't think I'm likely to have the time in the immediate future; I have too many other bugs to address now.  :-\
I'm pretty sure that you can test whether stuff is leaking using dbaron's Leak Gauge tool [0].

That said, the latest patch doesn't make the leaks I'm seeing go away.

[0] http://www.squarefree.com/2006/01/13/memory-leak-detection-tool/
This is what I did:

1. Start Firefox with ./firefox -P trunk http://slashdot.org/. 
2. Click on the RSS icon in the location bar.
2. Go to mozilla.com (I just had a bookmark in my bookmarks toolbar and it was convenient to click).

I could be seeing a completely different leak. Who knows! But I'm assuming this is the leak described in this bug. 

Also, using the trace refcnt leak tool (defining XPCOM_MEM_LEAK_LOG, etc.) it looks like we're leaking the world with these steps above.
(In reply to comment #8)
> 
> I could be seeing a completely different leak.

I think you might be. I can reproduce the leak you describe though, so I will check it out and file a new bug if needed.
>
> I think you might be. I can reproduce the leak you describe though, so I will
> check it out and file a new bug if needed.

OK, I think this is something different.

<http://lxr.mozilla.org/seamonkey/source/browser/components/feeds/src/FeedWriter.js#486 >

This seems to fix the leak you're reporting:

487   /**
488    * See nsIFeedWriter
489    */
490   close: function FW_close() {

+     this._document = null;
+     this._window = null;

491     var prefs =   
492         Cc["@mozilla.org/preferences-service;1"].
493         getService(Ci.nsIPrefBranch2);
494     prefs.removeObserver(PREF_SELECTED_ACTION, this);
495     prefs.removeObserver(PREF_SELECTED_READER, this);
496     prefs.removeObserver(PREF_SELECTED_APP, this);
497   },
498     
Status: NEW → ASSIGNED
(In reply to comment #9)
> (In reply to comment #8)
> > 
> > I could be seeing a completely different leak.
> 
> I think you might be. I can reproduce the leak you describe though, so I will
> check it out and file a new bug if needed.
> 

Bug 347824
Comment on attachment 231758 [details] [diff] [review]
store the feed by nsIURI instance

r=ben@mozilla.org
Attachment #231758 - Flags: review?(bugs) → review+
Checking in public/nsIFeedResultService.idl;
/cvsroot/mozilla/browser/components/feeds/public/nsIFeedResultService.idl,v  <--  nsIFeedResultService.idl
new revision: 1.6; previous revision: 1.5
done
Checking in src/FeedConverter.js;
/cvsroot/mozilla/browser/components/feeds/src/FeedConverter.js,v  <--  FeedConverter.js
new revision: 1.14; previous revision: 1.13
done
Checking in src/FeedWriter.js;
/cvsroot/mozilla/browser/components/feeds/src/FeedWriter.js,v  <--  FeedWriter.js
new revision: 1.10; previous revision: 1.9
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][needs review ben]
Attachment #231758 - Flags: approval1.8.1?
Comment on attachment 231758 [details] [diff] [review]
store the feed by nsIURI instance

a=drivers for MOZILLA_1_8_BRANCH
Attachment #231758 - Flags: approval1.8.1? → approval1.8.1+
Comment on attachment 231758 [details] [diff] [review]
store the feed by nsIURI instance

This patch doesn't apply cleanly to the branch.
Comment on attachment 231758 [details] [diff] [review]
store the feed by nsIURI instance

Robert, can we get an unbitrotted patch?
Attachment #231758 - Flags: approval1.8.1+ → approval1.8.1-
Attached patch branch patchSplinter Review
The rot happened when Mano upgraded the interface - no risk here.
Attachment #234279 - Flags: approval1.8.1?
Comment on attachment 234279 [details] [diff] [review]
branch patch

a=beltzner on behalf of drivers for the MOZILLA_1_8_BRANCH, please mark fixed1.8.1 when you check in.
Attachment #234279 - Flags: approval1.8.1? → approval1.8.1+
Checking in browser/components/feeds/src/FeedConverter.js;
/cvsroot/mozilla/browser/components/feeds/src/FeedConverter.js,v  <--  FeedConverter.js
new revision: 1.1.2.18; previous revision: 1.1.2.17
done
Checking in browser/components/feeds/src/FeedWriter.js;
/cvsroot/mozilla/browser/components/feeds/src/FeedWriter.js,v  <--  FeedWriter.js
new revision: 1.2.2.14; previous revision: 1.2.2.13
done
Keywords: fixed1.8.1
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: