Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector is already in core, but we are not using it. It can get the current PHP memory_limit setting and convert it into a byte count.

The attached patch updates drupal_check_memory_limit() to use MemoryDataCollector and also simplifies everything.

CommentFileSizeAuthor
use-MemoryDataCollector.patch8.98 KBjbrown

Comments

Status: Needs review » Needs work

The last submitted patch, use-MemoryDataCollector.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dawehner’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

We have a new method in ... \Drupal\Component\Utility\Environment::checkMemoryLimit
In general I think with https://github.com/symfony/symfony/pull/18450 we should not add a dependency to a new component just for this function.