You are here

function devel_shutdown_memory in Devel 7

Returns the rendered memory usage.

Return value

string

1 call to devel_shutdown_memory()
devel_shutdown_summary in ./devel.module
Returns the rendered shutdown summary.

File

./devel.module, line 1232
This module holds functions useful for Drupal development.

Code

function devel_shutdown_memory() {
  global $memory_init;
  if (variable_get('devel_memory', FALSE)) {
    $memory_shutdown = memory_get_usage();
    $args = array(
      '@memory_boot' => round($memory_init / 1024 / 1024, 2),
      '@memory_shutdown' => round($memory_shutdown / 1024 / 1024, 2),
      '@memory_peak' => round(memory_get_peak_usage(TRUE) / 1024 / 1024, 2),
    );
    $msg = '<span class="dev-memory-usages"> Memory used at: devel_boot()=<strong>@memory_boot</strong> MB, devel_shutdown()=<strong>@memory_shutdown</strong> MB, PHP peak=<strong>@memory_peak</strong> MB.</span>';

    // theme() may not be available. not t() either.
    return t_safe($msg, $args);
  }
}