You are here

public function XmlSitemapGenerator::getMemoryUsage in XML sitemap 8

Same name and namespace in other branches
  1. 2.x src/XmlSitemapGenerator.php \Drupal\xmlsitemap\XmlSitemapGenerator::getMemoryUsage()

Get how much memory was used.

Parameters

bool $start: Start value.

Return value

int Used memory.

Overrides XmlSitemapGeneratorInterface::getMemoryUsage

File

src/XmlSitemapGenerator.php, line 206

Class

XmlSitemapGenerator
XmlSitemap generator service class.

Namespace

Drupal\xmlsitemap

Code

public function getMemoryUsage($start = FALSE) {
  $current = memory_get_peak_usage(TRUE);
  if (!isset(self::$memoryStart) || $start) {
    self::$memoryStart = $current;
  }
  return $current - self::$memoryStart;
}