Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

File Size: 84 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Horde_Support_Memory:: (2 methods):
  push()
  pop()


Class: Horde_Support_Memory  - X-Ref

Simple interface for tracking memory consumption.

<code>
$t = new Horde_Support_Memory;
$t->push();
$used = $t->pop();
</code>

Do not expect too much of this memory tracker. Profiling memory is not
trivial as your placement of the measurements may obscure important
information. As a trivial example: Assuming that your script used 20 MB of
memory befory you call push() the information you get when calling pop()
might only tell you that there was less than 20 MB of memory consumed in
between the two calls. Take the changes to internal memory handling of PHP in
between the different versions into account
(http://de3.php.net/manual/en/features.gc.performance-considerations.php) and
you should get an idea about why you might be cautious about the values you
get from this memory tracker.

Copyright 2011-2017 Horde LLC (http://www.horde.org/)

push()   X-Ref
Push a new tracker on the stack.


pop()   X-Ref
Pop the latest tracker and return the difference with the current
memory situation.

return: array The change in memory allocated via emalloc() in between the