When using oauth-subscriber
in cron for multiple times their is a memory leak. Here is a basic test I did.
function oauth_1_stack($token = NULL, $token_secret = NULL)
{
$stack = HandlerStack::create();
$middleware = new Oauth1([
'consumer_key' => 'consumer_key',
'consumer_secret' => 'consumer_secret',
'token' => $token,
'token_secret' => $token_secret,
]);
$stack->push($middleware);
$options = [
'handler' => $stack,
'auth' => 'oauth'
];
unset($stack, $middleware);
return $options;
}
echo memory_get_usage() . "
"; // 4017480
$options = oauth_1_stack();
echo memory_get_usage() . "
"; // 4509824
unset($options);
echo memory_get_usage() . "
"; // 4480032
GitHub issue I logged: https://github.com/guzzle/oauth-subscriber/issues/47
So can I do something to counterfeit this leak?