hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Memory leak on $array+=array()

Open imsamurai opened this issue 11 years ago • 3 comments

Here is a simplified test http://3v4l.org/64TZi

imsamurai avatar Dec 19 '14 13:12 imsamurai

Looks like it doesn't leak if you put it in a function. Another workaround: $res = $res + array();

Pomyk avatar Dec 19 '14 21:12 Pomyk

The bug in "+=" was fixed in #3740 though your test case still shows the leak because you're also computing memory consumed jitting the pseudomain, if you memory_get_usage(false) you'll see that the request memory usage is flat (you can also run with the jit off to see the same thing).

paulbiss avatar Apr 15 '15 21:04 paulbiss

:+1:

imsamurai avatar Apr 17 '15 12:04 imsamurai