Monday, July 7, 2008

Memory Leaks in PHP

There is a huge memory leak in PHP 5.2 and earlier. When objects nest other objects within it with circular reference, the nested object is never unset when un-setting the object that is instantiating the other objects. The solution would be to upgrade to latest version of PHP 5.3 when it is stable, or un-setting all the objects that get instantiated within an object. Some more solutions are proposed at Memory Leaks in PHP. Another author looks at this problem at Memory Leaks in PHP. The author also tries to propose a solution by modifying the PHP internals and decrement the reference count. This is beyond my scope and time constraints me to do this.

No comments: