Memory warning hook
| From: | nathan at starin dot biz | Date: | Tue, 05 Mar 2013 18:23:35 +0000 |
| Subject: | Memory warning hook | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-66473@lists.php.net to get a copy of this message | ||
As PHP applications are turning into large frameworks one of the issues
arriving is memory management. One of the issues is that many frameworks use
sophisticated caching techniques to make accessing the same data quickly,
this improves speed it is at the cost of memory. Often the developer knows
these areas that cache and often times already have functions in place to
clear out the cache, however in the case where PHP is approaching or exceeds
memory limits PHP runs the GC then dies if it cannot allocate enough memory.
If we implemented "memory warning" triggers or user function that will be
called before the GC is executed which allows the user to try and free up
some memory on their own. This hopefully would give more flexibility to
allowing these advanced caching techniques but at the same time allow the
cache to be cleared out in case memory is getting low.
Thoughts?
Thanks,
Software Developer
Nathan Bruer