Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.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