You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #48461 [VarExporter] Fix possible memory-leak when using lazy-objects (nicolas-grekas)
This PR was merged into the 6.2 branch.
Discussion
----------
[VarExporter] Fix possible memory-leak when using lazy-objects
| Q | A
| ------------- | ---
| Branch? | 6.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #48382
| License | MIT
| Doc PR | -
I would have loved to *not* store lazy-initializers in lazy objects, but this is not possible in PHP at the moment (see php/php-src#10043 for details).
This PR moves storing state of lazy objects inside the objects themselves. This fixes the memory leak by allowing the garbage collector to free memory as needed. This has the drawback of adding noise when `var_dump($lazyObject)`, but at least we can make `dump($lazyObject)` aware of that, thus the change on VarDumper.
Commits
-------
ce1ff9f700 [VarExporter] Fix possible memory-leak when using lazy-objects
0 commit comments