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
2097152
2097152