The Webfeeds module provides what is needed for parsing, storing and displaying RSS and Atom feeds. The external API of the WebFeeds module goes through the WebFeedsAPI class.
The module currently parses the following formats:
The external API of the WebFeeds module goes through the WebFeedsAPI class.
Generated API documentation, if you've run Doxygen on this module.
This module requires FEATURE_WEBFEEDS_BACKEND to be defined.
The module is also able to create XML/HTML-data ready for display if FEATURE_WEBFEEDS_DISPLAY is enabled.
All methods in the external API which can cause an error will return an OP_STATUS which should be checked for ERR_NO_MEMORY and ERR. A few internal methods use TRAP/LEAVE, but this should be invisible to the external API.
The callback method OnFeedLoaded will return a status of STATUS_OOM if it encountered a OOM condition during loading.
The module will handle the error itself if it is able to, but in most cases it isn't and will the return the error in an OP_STATUS, and the caller will have to handle the error.
When parsing a feed (which will also happen when loading it) a WebFeed object will be created for the feed, and a WebFeedEntry object for each entry in the feed. These will contain most of the text of the feed plus some status information. So memory use will be roughly proportional to the size of the XML-data it parses.
The module will keep some feeds in memory also after they are parsed. If disk storage of feeds is enabeled then the number is controlled by TWEAK_WEBFEEDS_MAX_FEEDS_IN_MEMORY. Although more may be kept in memory if their reference count says someone outside the module is using it. Without disk storage all parsed feeds will remain in memory. That could certainly see some improvement.
Stack memory use should be low, as the module does no recursive calls, and allocates no big structures on the stack. But the XML-parser might, see below.
The module does not use the tempbuffers from the memory manager.
The number of feeds cached in memory can be somewhat controlled by TWEAK_WEBFEEDS_MAX_FEEDS_IN_MEMORY. But the number of feeds kept may be higher if external users of the module have references to feeds.
There are no specific memory tests for this module.
In general just loading a feed should use most of the code in the module.
During parsing it uses the XML-parser (the internal in core-2, expat in core-1). Check the documentation for the XML-parser to find out how much memory that uses.