Is it possible to find out (programmatically) if the current PHP process is about to run out of memory?
Some Background:
I am the author of the Bulk Delete WordPress plugin, which allows people to delete posts, users etc in bulk.
One common complaint I get from my plugin users is that they get a blank page when trying to delete huge amount of posts. This happens because PHP runs out of memory.
If I can find out that the PHP process is about to run out of memory, then I can try to delete in batches or at least give a warning to the user, instead of just throwing a blank page.