IssueRaiser

PHP is reference counted, so memory is typically freed as soon as an object is no longer needed.

PHP is reference counted, so memory is typically freed as soon as an object is no longer needed. Cycles are the exception which can cause memory leaks, so in version 5.3 php added a cycle collector, which reads every object in memory and very occasionally deletes objects that are disconnected and have greater than zero reference counts (cycles). In my opinion, the php cycle collector is a pointless waste of time. In objective-c, apple just let's the memory leak by default, and they give you tools to find the leaks, and then you modify the code to break the cycles. There is no need to turn cycle collection back on at the end of the program, because OS frees the memory at program termination.

Posted by jcampbell1 on Dec 2, 2014, 2:16 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.9,000 issues0 comments

hackernews (Software)

PHP is reference counted, so memory is typically freed as soon as an object is no longer needed.

jcampbell1Dec 2, 2014, 2:16 PM

PHP is reference counted, so memory is typically freed as soon as an object is no longer needed. Cycles are the exception which can cause memory leaks, so in version 5.3 php added a cycle collector, which reads every object in memory and very occasionally deletes objects that are disconnected and have greater than zero reference counts (cycles). In my opinion, the php cycle collector is a pointless waste of time. In objective-c, apple just let's the memory leak by default, and they give you tools to find the leaks, and then you modify the code to break the cycles. There is no need to turn cycle collection back on at the end of the program, because OS frees the memory at program termination.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue