Open dotdash opened 3 months ago
FWIW, I have created a derived class locally, that simply drops the stacked data from the session whenever collecting data:
/**
* @return mixed[]
*/
public function collect(): array
{
$http = $this->initStackSession();
// Avoid quadratic memory usage growth by removing any stacked data
// from the session, as the stacked data may also contains the session
$stack = $http->getSessionValue($this->stackSessionNamespace);
$http->deleteSessionValue($this->stackSessionNamespace);
$data = parent::collect();
$stack = $http->setSessionValue($this->stackSessionNamespace, $stack);
return $data;
}
Open a pull request 👍
The request data collector store the data from
$_SESSION
which contains the stacked data, which in turn contains the data from the request collector, etc, so memory usage double with each request. So with multiple requests that have a request data collector and getting stacked, that becomes a problem rather quickly.