Collecting Data in Symfony by Request and Response

Code
<?php

use Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector;
use 
Symfony\Component\HttpFoundation\Request;
use 
Symfony\Component\HttpFoundation\Response;

$dataCollector = new MemoryDataCollector();

$request Request::createFromGlobals();
$response = (new Response('blabla'))->prepare($request);
$dataCollector->collect($request$response);

echo 
$dataCollector->getMemory() . PHP_EOL;

$array range(010000);

$dataCollector->updateMemoryUsage();
echo 
$dataCollector->getMemory() . PHP_EOL;
Result
8388608
10485760
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6