Actually, this is not a memory leak, but static caches that are not cleared!
This is due to SimplePie_IRI::set_iri (and set_authority and set_path ). They set the static $cache variable, but they will not cancel or clear it when creating a new SimplePie instance, which means the variables are getting bigger and bigger.
This can be fixed by changing
public function set_authority($authority) { static $cache; if (!$cache) $cache = array();
to
public function set_authority($authority, $clear_cache = false) { static $cache; if ($clear_cache) { $cache = null; return; } if (!$cache) $cache = array();
.. etc. in the following functions:
set_iri ,set_authority ,set_path ,
And adding a destructor to SimplePie_IRI that calls all functions using a static cache with the true parameter in $ clear_cache will work:
public function __destruct() { $this->set_iri(null, true); $this->set_path(null, true); $this->set_authority(null, true); }
Which now will not lead to an increase in memory consumption over time:

Git Problem
source share