Skip to content

Instantly share code, notes, and snippets.

@fabianbraun
Created August 31, 2012 11:24
Show Gist options
  • Save fabianbraun/3551667 to your computer and use it in GitHub Desktop.
Save fabianbraun/3551667 to your computer and use it in GitHub Desktop.
Memory usage test
<?php
class Foo {
function __construct()
{
$this->bar = new Bar($this);
}
}
class Bar {
function __construct($foo = null)
{
$this->foo = $foo;
}
}
$i = 0;
while (true) {
$foo = new Foo();
// $foo->__destruct();
unset($foo);
$i++;
if ($i % 100000 == 0) {
echo number_format(memory_get_usage()) . "\n";
}
}
?>
@fabianbraun
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment