Skip to content

Instantly share code, notes, and snippets.

@asm89
Created January 25, 2014 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asm89/8622724 to your computer and use it in GitHub Desktop.
Save asm89/8622724 to your computer and use it in GitHub Desktop.
Memory leak in hhvm?
<?php
class Foo
{
private $bar;
public function __construct(Bar $bar)
{
$this->bar = $bar;
}
}
class Bar
{
private $foo;
public function setFoo(Foo $foo)
{
$this->foo = $foo;
}
}
while(true) {
$bar = new Bar();
$foo = new Foo($bar);
$bar->setFoo($foo);
echo memory_get_usage() . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment