-
-
Notifications
You must be signed in to change notification settings - Fork 166
Closed
Labels
Description
Simple example for reproduce:
<?php
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
require_once __DIR__ . '/../../vendor/autoload.php';
$handler = function (ServerRequestInterface $request): ResponseInterface {
$memory = round(memory_get_peak_usage() / 1024, 2) . ' kbyte';
$response = new \React\Http\Response(200, [], 'message');
$response = $response->withHeader('X-Memory', $memory);
return $response;
};
$loop = \React\EventLoop\Factory::create();
$server = new \React\Http\Server($handler);
$socket = new \React\Socket\Server(8081, $loop);
$server->listen($socket);
$loop->run();Memory grows on every request after 20-40 requests.
"react/http": "^0.8"
PHP 7.2.0 (cli) (built: Dec 3 2017 21:46:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.2.0, Copyright (c) 1999-2017, by Zend Technologies