I'm using the dev version dated 2008-Aug-05. On trying to delete 2500 articles, I get the error message:
Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 1190 bytes) in /mypath/public_html/includes/database.mysql-common.inc on line 41
I had already increased my PHP memory allocation, by adding the following line to my .htaccess file:
php_value memory_limit 24M
I suspect that if I increased the memory allocation further, this error would disappear, though it would be nice if the error was (a) caught (b) the program deleted the nodes a small batch at a time.
For anyone interested, it took 1 minutes and 20 seconds to process the removal 2370 records, leaving just 130, which were deleted without problem.
Comments
Comment #1
iantresman commentedI can confirm that by increasing my PHP memory limit to 32M, prevented the error message.
Comment #2
kbahey commentedComment #4
gabor_h commentedI leave the "closed" status of this issue, although in my experience the deletion of tens of thousands of nodes results in "Fatal error: Allowed memory size exhausted". No matter what the PHP memory limit is, sooner or later it is reached.
So for those who would like to regularly delete a huge number of nodes , here is the solution I used:
1. Take the code of node_delete(), see e.g. http://api.drupal.org/api/function/node_delete/6
2. Copy/paste this function to delete_all.module, and rename it to _modified_node_delete()
3. Uncomment the function calls of watchdog and drupal_set_message in this _modified_node_delete() function.
4. Modify _delete_all_normal() in delete_all.module to call this _modified_node_delete() instead of node_delete().
5. Additionally I also removed cache_clear_all() from _modified_node_delete(), and moved it to the end of _delete_all_normal(), I put it just before "return $deleted".
This way I can delete over 100000 nodes without timeout or memory exhaustion.
Here is the result of the above steps:
Personally, I do not ask the maintainers to modify the delete_all.module, it is up to them, but I am happy to share this with those who need to delete many many many nodes.