I got an out of memory when deleting 1000s of nodes or comments

drush entity-delete node `drush entity-read node`

drush entity-delete comment `drush entity-read comment`

on Drupal 7.

We forgot to build a batch interface :-(

Comments

juampynr’s picture

clemens.tolboom, this is weird. PHP's memory_limit variable is hardcoded to 0 at php.ini.

clemens.tolboom’s picture

@juampy but the commands I gave contained prob 20K NIDs.

Drupal does a node_load_multiple(20K NIDs).

The numbers are not exactly but I ran out of memory (maybe 2GB)

(does that help?)

luksak’s picture

To me that happens with only one commerce product with a memory limit of 4GB...

clemens.tolboom’s picture

@Lukas von Blarer please add more context? What is one commerce product? What was the exact command?

luksak’s picture

It was something like drush entity-delete 1.

My commerce products contain nested field collections and are quite big objects. But no reason to use 4GB of memory.

clemens.tolboom’s picture

@Lukas von Blarer wow ... do you have some steps to reproduce?

luksak’s picture

Could be hard to reproduce... My products contain nested field collections. This is my suspected reason for this. Could this somehow cause a infinite loop trying to delete these field collections inside the product?

adriancid’s picture

Issue summary: View changes
Status: Active » Closed (outdated)
luksak’s picture

Status: Closed (outdated) » Active

Would you mind explaining why this is outdated? Has this been fixed? If not, this doesn't seem outdated to me.

adriancid’s picture

@Lukas von Blarer, sorry for that. I thought it was resolved.

luksak’s picture

I haven't tested it.

adriancid’s picture

@Lukas von Blarer can you test again to see if the problem persist?

luksak’s picture

I actually don't maintain the site anymore on which I faced this issue...

adriancid’s picture

Status: Active » Postponed (maintainer needs more info)